fix typo: 'mentiond' -> 'mentioned'

This commit is contained in:
chenhai
2023-08-05 22:03:09 +08:00
parent 88191e18b2
commit 78b6b5c0f2
2 changed files with 2 additions and 2 deletions

View File

@ -172,7 +172,7 @@ In Rust, many of the operators can be overloaded via traits. That is, some opera
use std::ops; use std::ops;
// Implement fn multiply to make the code work. // Implement fn multiply to make the code work.
// As mentiond 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 multipl

View File

@ -91,7 +91,7 @@ fn main() {
use std::ops; use std::ops;
// implement fn multiply to make the code work // implement fn multiply to make the code work
// As mentiond 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 multiply<T: ops::Mul<Output = T>>(x: T, y: T) -> T { fn multiply<T: ops::Mul<Output = T>>(x: T, y: T) -> T {
x * y x * y