From de7523c35e38182616beeb63bb4ca694ad713038 Mon Sep 17 00:00:00 2001 From: Sergey Kaunov <65976143+skaunov@users.noreply.github.com> Date: Wed, 5 Apr 2023 18:20:26 +0300 Subject: [PATCH 1/2] Update from-into.md Seems to be closer to the task. --- solutions/type-conversions/from-into.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solutions/type-conversions/from-into.md b/solutions/type-conversions/from-into.md index 8c9db2a..c9429e6 100644 --- a/solutions/type-conversions/from-into.md +++ b/solutions/type-conversions/from-into.md @@ -22,7 +22,7 @@ fn main() { assert_eq!(i1, i2); assert_eq!(i1, 0); - let i3: u32 = 'a' as u32 ; + let i3: i32 = 'a' as i32 ; let s: String = String::from('a'); } @@ -141,4 +141,4 @@ fn main() { let result: Result = 5i32.try_into(); assert_eq!(result, Err(())); } -``` \ No newline at end of file +``` From fdac246cfd6dbf93992c05a5fca7857b2d7d8b8c Mon Sep 17 00:00:00 2001 From: Sergey Kaunov <65976143+skaunov@users.noreply.github.com> Date: Wed, 5 Apr 2023 18:23:40 +0300 Subject: [PATCH 2/2] Update from-into.md rewording of the task to be less confusing --- en/src/type-conversions/from-into.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/en/src/type-conversions/from-into.md b/en/src/type-conversions/from-into.md index 024e221..ab1d534 100644 --- a/en/src/type-conversions/from-into.md +++ b/en/src/type-conversions/from-into.md @@ -36,7 +36,8 @@ fn main() { assert_eq!(i1, 0); // FIX the error in two ways - // 1. impl From for ? , maybe you should check the docs mentiond above to find the answer + /* 1. use a similar type which `impl From`, maybe you + should check the docs mentiond above to find the answer */ // 2. a keyword from the last chapter let i3: i32 = 'a'.into(); @@ -170,4 +171,4 @@ fn main() { } ``` -> 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 +> 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