diff --git a/Readme.md b/Readme.md index 25514e5..98995a3 100644 --- a/Readme.md +++ b/Readme.md @@ -18,7 +18,7 @@ Although they are so awesome, we have our own secret weapons :) - Besides examples, we have `a lot of exercises`, you can Read, Edit and Run them ONLINE -- Covering nearly all aspects of Rust, such as async/await, threads, sync primitives, optimizing and standard libraries** etc. +- Covering nearly all aspects of Rust, such as async/await, threads, sync primitives, optimizing and standard libraries etc. - Every exercise has its own solutions diff --git a/zh-CN/src/basic-types/numbers.md b/zh-CN/src/basic-types/numbers.md index 6ef4fa9..03e315b 100644 --- a/zh-CN/src/basic-types/numbers.md +++ b/zh-CN/src/basic-types/numbers.md @@ -40,7 +40,7 @@ fn main() { assert_eq!("u32".to_string(), type_of(&x)); } -// 以下还输可以获取传入参数的类型,并返回类型的字符串形式,例如 "i8", "u8", "i32", "u32" +// 以下函数可以获取传入参数的类型,并返回类型的字符串形式,例如 "i8", "u8", "i32", "u32" fn type_of(_: &T) -> String { format!("{}", std::any::type_name::()) } @@ -142,6 +142,7 @@ fn main() { // 整数减法 assert!(1i32 - 2 == __); assert!(1u8 - 2 == -1); + assert!(3 * 50 == __); assert!(9.6 / 3.2 == 3.0); // error ! 修改它让代码工作 @@ -162,4 +163,4 @@ fn main() { } ``` -> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下) \ No newline at end of file +> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下) diff --git a/zh-CN/src/ownership/borrowing.md b/zh-CN/src/ownership/borrowing.md index 2af1dd9..aee9771 100644 --- a/zh-CN/src/ownership/borrowing.md +++ b/zh-CN/src/ownership/borrowing.md @@ -108,7 +108,7 @@ fn main() { ``` #### 可变性 -8. 🌟 错误: 从可不用对象借用可用 +8. 🌟 错误: 从不可变对象借用可变 ```rust,editable fn main() { @@ -167,4 +167,4 @@ fn main() { } ``` -> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下) \ No newline at end of file +> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)