fix type for traits.md

This commit is contained in:
so2liu
2024-03-28 20:12:24 +08:00
committed by GitHub
parent 303bcf08e7
commit 905facd745

View File

@@ -174,7 +174,7 @@ use std::ops;
// Implement fn multiply to make the code work. // Implement fn multiply to make the code work.
// As mentioned above, `+` needs `T` to implement `std::ops::Add` Trait. // As mentioned above, `+` needs `T` to implement `std::ops::Add` Trait.
// So, what about `*`? You can find the answer here: https://doc.rust-lang.org/core/ops/ // So, what about `*`? You can find the answer here: https://doc.rust-lang.org/core/ops/
fn multipl fn multiply
fn main() { fn main() {
assert_eq!(6, multiply(2u8, 3u8)); assert_eq!(6, multiply(2u8, 3u8));
@@ -469,4 +469,4 @@ fn main() {
} }
``` ```
> You can find the solutions [here](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/traits.md)(under the solutions path), but only use it when you need it :) > You can find the solutions [here](https://github.com/sunface/rust-by-practice/blob/master/solutions/generics-traits/traits.md)(under the solutions path), but only use it when you need it :)