Skip to content

Commit

Permalink
Traits where syntax's extra usage example more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranbo committed Jun 17, 2016
1 parent be203ac commit d0a0bef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/doc/book/traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,10 @@ fn normal<T: ConvertTo<i64>>(x: &T) -> i64 {
}

// can be called with T == i64
fn inverse<T>() -> T
fn inverse<T>(x: i32) -> T
// this is using ConvertTo as if it were "ConvertTo<i64>"
where i32: ConvertTo<T> {
42.convert()
x.convert()
}
```

Expand Down

0 comments on commit d0a0bef

Please sign in to comment.