summaryrefslogtreecommitdiff
path: root/exercises/conversions/from_str.rs
diff options
context:
space:
mode:
authorIkaR49 <IkaR49@users.noreply.github.com>2020-05-16 00:02:57 +0300
committerGitHub <noreply@github.com>2020-05-15 23:02:57 +0200
commit763aa6e378a586caae2d8d63755a85eeba227933 (patch)
treea2a7763bf8f8a9857f04782f075259e6e61101ef /exercises/conversions/from_str.rs
parentd6c0a688e6a96f93ad60d540d4b326f342fc0d45 (diff)
feat: Rewrite try_from_into (#393)
Diffstat (limited to 'exercises/conversions/from_str.rs')
-rw-r--r--exercises/conversions/from_str.rs3
1 files changed, 2 insertions, 1 deletions
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
+}