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] =?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 路径下)