From 2309fac72072b288fe5c8c5b852ef7707f6c4def Mon Sep 17 00:00:00 2001 From: Gengen Wang <35788677+XuGuangnian@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:39:18 +0800 Subject: [PATCH] add "3, 4" answers with Spaces for Q3 of type-conversions/others add `.map(|x| x.trim())` for Q3 of type-conversions/others Added "3, 4" answers with Spaces --- en/src/type-conversions/others.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/en/src/type-conversions/others.md b/en/src/type-conversions/others.md index 5f18d7b..3f06945 100644 --- a/en/src/type-conversions/others.md +++ b/en/src/type-conversions/others.md @@ -60,6 +60,7 @@ impl FromStr for Point { fn from_str(s: &str) -> Result { let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' ) .split(',') + .map(|x| x.trim()) .collect(); let x_fromstr = coords[0].parse::()?; @@ -164,4 +165,4 @@ fn main() { } ``` -> 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 +> 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