summaryrefslogtreecommitdiff
path: root/rustlings-macros/info.toml
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-02 01:03:55 +0200
committermo8it <mo8it@proton.me>2024-07-02 01:03:55 +0200
commite3c8c457ba8744b0f1b799c4d7d4bf24e8e61792 (patch)
tree96a29d5bdcf2a04bfad17e4fd6da71f6766f33ca /rustlings-macros/info.toml
parentcddaf4881ea5a03e6deebfa9ec949347e1c2d025 (diff)
from_str solution
Diffstat (limited to 'rustlings-macros/info.toml')
-rw-r--r--rustlings-macros/info.toml10
1 files changed, 4 insertions, 6 deletions
diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml
index b848e0e..4ef1a0a 100644
--- a/rustlings-macros/info.toml
+++ b/rustlings-macros/info.toml
@@ -1183,13 +1183,11 @@ hint = """
The implementation of `FromStr` should return an `Ok` with a `Person` object,
or an `Err` with an error if the string is not valid.
-This is almost like the `from_into` exercise, but returning errors instead
-of falling back to a default value.
+This is almost like the previous `from_into` exercise, but returning errors
+instead of falling back to a default value.
-Look at the test cases to see which error variants to return.
-
-Another hint: You can use the `map_err` method of `Result` with a function
-or a closure to wrap the error from `parse::<usize>`.
+Another hint: You can use the `map_err` method of `Result` with a function or a
+closure to wrap the error from `parse::<u8>`.
Yet another hint: If you would like to propagate errors by using the `?`
operator in your solution, you might want to look at