diff --git a/zh-CN/src/type-conversions/others.md b/zh-CN/src/type-conversions/others.md index 9503340..35b55ef 100644 --- a/zh-CN/src/type-conversions/others.md +++ b/zh-CN/src/type-conversions/others.md @@ -61,6 +61,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::()?; @@ -165,4 +166,4 @@ fn main() { } ``` -> 你可以在[这里](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/others.md)找到答案(在 solutions 路径下) \ No newline at end of file +> 你可以在[这里](https://github.com/sunface/rust-by-practice/blob/master/solutions/type-conversions/others.md)找到答案(在 solutions 路径下)