From 0b224b7bc63a74113aa24f39f4b03bf3445d7bb3 Mon Sep 17 00:00:00 2001 From: IkaR49 <IkaR49@users.noreply.github.com> Date: Thu, 14 May 2020 20:59:42 +0300 Subject: [PATCH] chore(from_str): Add hint's chunk from old try_from_into --- exercises/conversions/from_str.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/conversions/from_str.rs b/exercises/conversions/from_str.rs index 14e9e09..014d054 100644 --- a/exercises/conversions/from_str.rs +++ b/exercises/conversions/from_str.rs @@ -17,6 +17,7 @@ struct Person { // 3. Extract the first element from the split operation and use it as the name // 4. If the name is empty, then return an error // 5. Extract the other element from the split operation and parse it into a `usize` as the age +// with something like `"4".parse::<usize>()`. // If while parsing the age, something goes wrong, then return an error // Otherwise, then return a Result of a Person object impl FromStr for Person { @@ -82,4 +83,4 @@ mod tests { ",one".parse::<Person>().unwrap(); } -} \ No newline at end of file +}