Merge pull request #514 from so2liu/master

fix type for traits.md
This commit is contained in:
Sunface
2024-04-02 13:28:16 +08:00
committed by GitHub

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 :)