From 679bc95397c2c8bd3d57d8a32fc136492993c3fa Mon Sep 17 00:00:00 2001 From: Somoku Date: Mon, 29 Aug 2022 15:52:39 +0800 Subject: [PATCH] update: answer reference in "type-conversions" --- en/src/type-conversions/as.md | 2 ++ en/src/type-conversions/from-into.md | 4 +++- en/src/type-conversions/others.md | 4 +++- zh-CN/{deploy => deploy.sh} | 0 zh-CN/src/type-conversions/as.md | 2 ++ zh-CN/src/type-conversions/from-into.md | 8 +++++--- zh-CN/src/type-conversions/others.md | 6 ++++-- 7 files changed, 19 insertions(+), 7 deletions(-) rename zh-CN/{deploy => deploy.sh} (100%) mode change 100755 => 100644 diff --git a/en/src/type-conversions/as.md b/en/src/type-conversions/as.md index 4b27fe3..451ac7e 100644 --- a/en/src/type-conversions/as.md +++ b/en/src/type-conversions/as.md @@ -103,3 +103,5 @@ fn main() { println!("Success!"); } ``` + +> You can find the solutions [here](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/as.md)(under the solutions path), but only use it when you need it \ No newline at end of file diff --git a/en/src/type-conversions/from-into.md b/en/src/type-conversions/from-into.md index a6cefa9..024e221 100644 --- a/en/src/type-conversions/from-into.md +++ b/en/src/type-conversions/from-into.md @@ -168,4 +168,6 @@ fn main() { println!("Success!"); } -``` \ No newline at end of file +``` + +> You can find the solutions [here](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/from-into.md)(under the solutions path), but only use it when you need it \ No newline at end of file diff --git a/en/src/type-conversions/others.md b/en/src/type-conversions/others.md index 680e0b4..5f18d7b 100644 --- a/en/src/type-conversions/others.md +++ b/en/src/type-conversions/others.md @@ -162,4 +162,6 @@ fn main() { // literal assert_eq!(b"Rust", &[82, 117, 115, 116]); } -``` \ No newline at end of file +``` + +> You can find the solutions [here](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/others.md)(under the solutions path), but only use it when you need it \ No newline at end of file diff --git a/zh-CN/deploy b/zh-CN/deploy.sh old mode 100755 new mode 100644 similarity index 100% rename from zh-CN/deploy rename to zh-CN/deploy.sh diff --git a/zh-CN/src/type-conversions/as.md b/zh-CN/src/type-conversions/as.md index c7da3b0..c49ba32 100644 --- a/zh-CN/src/type-conversions/as.md +++ b/zh-CN/src/type-conversions/as.md @@ -100,3 +100,5 @@ fn main() { } } ``` + +> 你可以在[这里](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/as.md)找到答案(在 solutions 路径下) diff --git a/zh-CN/src/type-conversions/from-into.md b/zh-CN/src/type-conversions/from-into.md index 83a568e..00d8f53 100644 --- a/zh-CN/src/type-conversions/from-into.md +++ b/zh-CN/src/type-conversions/from-into.md @@ -6,7 +6,7 @@ 需要注意的是,当使用 `into` 方法时,你需要进行显式地类型标注,因为编译器很可能无法帮我们推导出所需的类型。 -来看一个例子,我们可以简单的将 `&str` 转换成 `String`。` +来看一个例子,我们可以简单的将 `&str` 转换成 `String` ```rust fn main() { let my_str = "hello"; @@ -107,7 +107,7 @@ fn main() { ### TryFrom/TryInto -类似于 `From` 和 `Into`, `TryFrom` 和 `TryInto` 也是用于类型转换的泛型特。 +类似于 `From` 和 `Into`, `TryFrom` 和 `TryInto` 也是用于类型转换的泛型特征。 但是又与 `From/Into` 不同, `TryFrom` 和 `TryInto` 可以对转换后的失败进行处理,然后返回一个 `Result`。 @@ -165,4 +165,6 @@ fn main() { println!("Success!") } -``` \ No newline at end of file +``` + +> 你可以在[这里](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/from-into.md)找到答案(在 solutions 路径下) \ No newline at end of file diff --git a/zh-CN/src/type-conversions/others.md b/zh-CN/src/type-conversions/others.md index f1d7f2f..9503340 100644 --- a/zh-CN/src/type-conversions/others.md +++ b/zh-CN/src/type-conversions/others.md @@ -41,7 +41,7 @@ fn main() { println!("Success!") } -``` +``` 3. 🌟🌟 还可以为自定义类型实现 `FromStr` 特征 @@ -163,4 +163,6 @@ fn main() { // literal assert_eq!(b"Rust", &[82, 117, 115, 116]); } -``` \ No newline at end of file +``` + +> 你可以在[这里](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/others.md)找到答案(在 solutions 路径下) \ No newline at end of file