Skip to content

Commit 5d9a509

Browse files
committed
Minor fixes to traits post
1 parent 3f90971 commit 5d9a509

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/2015-05-11-traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static call to the relevant implementation:
186186
```rust
187187
// The compiled code:
188188
__print_hash_bool(&true); // invoke specialized bool version directly
189-
__print_hash_i64(&true); // invoke specialized i64 version directly
189+
__print_hash_i64(&12_i64); // invoke specialized i64 version directly
190190
```
191191

192192
This compilation model isn't so useful for a function like `print_hash`, but
@@ -348,7 +348,7 @@ wind up playing a few other important roles in Rust. Here's a taste:
348348
method is defined with multiple signatures. But traits provide much of the
349349
benefit of overloading: if a method is defined generically over a trait, it
350350
can be called with any type implementing that trait. Compared to traditional
351-
overloading, this has two advantages. First, it means the overloading is not
351+
overloading, this has two advantages. First, it means the overloading is less
352352
[ad hoc][adhoc]: once you understand a trait, you immediately understand the
353353
overloading pattern of any APIs using it. Second, it is *extensible*: you can
354354
effectively provide new overloads downstream from a method by providing new

0 commit comments

Comments
 (0)