mirror of https://github.com/rust-lang/book
Fix normal function call signature
The normal function should not take a reference to an i32, since the inverse function does not take a reference to T. Giving these functions identical call signatures improves clarity, and it makes more sense to pass integers normally than by reference.
This commit is contained in:
parent
91ff25e96d
commit
aecb6abab4
|
@ -414,7 +414,7 @@ impl ConvertTo<i64> for i32 {
|
|||
}
|
||||
|
||||
// Can be called with T == i32.
|
||||
fn normal<T: ConvertTo<i64>>(x: &T) -> i64 {
|
||||
fn normal<T: ConvertTo<i64>>(x: T) -> i64 {
|
||||
x.convert()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue