From 5ed1a56076e479918b55533b1bf78d3b027a2aac Mon Sep 17 00:00:00 2001 From: 863056768 <51009484+863056768@users.noreply.github.com> Date: Sun, 6 Mar 2022 10:21:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=BF=98=E8=BE=93=20>=20=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-CN/src/basic-types/numbers.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 路径下) From ae2616c46b114370b2608913aab8262b67eb10c4 Mon Sep 17 00:00:00 2001 From: 863056768 <51009484+863056768@users.noreply.github.com> Date: Sun, 6 Mar 2022 16:34:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8F=AF=E4=B8=8D=E7=94=A8=20=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=20>=20=E4=B8=8D=E5=8F=AF=E5=8F=98=20=E5=8F=AF?= =?UTF-8?q?=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-CN/src/ownership/borrowing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 路径下) From 9e4f7c1e65745b42f21f636268cf8c2f7cbe41e4 Mon Sep 17 00:00:00 2001 From: Sunface Date: Mon, 7 Mar 2022 09:32:15 +0800 Subject: [PATCH 3/3] Update Readme.md --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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