Skip to content

Commit

Permalink
Rename normal and inverse functions
Browse files Browse the repository at this point in the history
For improved clarity.
  • Loading branch information
adammartinez271828 authored Mar 28, 2017
1 parent aecb6ab commit 47f4de5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions first-edition/src/traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,12 @@ impl ConvertTo<i64> for i32 {
}

// Can be called with T == i32.
fn normal<T: ConvertTo<i64>>(x: T) -> i64 {
fn convert_t_to_i64<T: ConvertTo<i64>>(x: T) -> i64 {
x.convert()
}

// Can be called with T == i64.
fn inverse<T>(x: i32) -> T
fn convert_i32_to_t<T>(x: i32) -> T
// This is using ConvertTo as if it were "ConvertTo<i64>".
where i32: ConvertTo<T> {
x.convert()
Expand Down

0 comments on commit 47f4de5

Please sign in to comment.