File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -893,7 +893,19 @@ path = "exercises/conversions/try_from_into.rs"
893
893
mode = " test"
894
894
hint = """
895
895
Follow the steps provided right before the `TryFrom` implementation.
896
- You can also use the example at https://doc.rust-lang.org/std/convert/trait.TryFrom.html"""
896
+ You can also use the example at https://doc.rust-lang.org/std/convert/trait.TryFrom.html
897
+
898
+ You might want to look back at the exercise errorsn (or its hints) to remind
899
+ yourself about how `Box<dyn Error>` works.
900
+
901
+ If you're trying to return a string as an error, note that neither `str`
902
+ nor `String` implements `error::Error`. However, there is an implementation
903
+ of `From<&str>` for `Box<dyn Error>`. This means you can use `.into()` or
904
+ the `?` operator to convert your string into the correct error type.
905
+
906
+ If you're having trouble with using the `?` operator to convert an error string,
907
+ recall that `?` works to convert `Err(something)` into the appropriate error
908
+ type for returning from the function."""
897
909
898
910
[[exercises ]]
899
911
name = " as_ref_mut"
@@ -909,4 +921,7 @@ mode = "test"
909
921
hint = """
910
922
The implementation of FromStr should return an Ok with a Person object,
911
923
or an Err with an error if the string is not valid.
912
- This is almost like the `try_from_into` exercise."""
924
+ This is almost like the `try_from_into` exercise.
925
+
926
+ If you're having trouble with returning the correct error type, see the
927
+ hints for try_from_into."""
You can’t perform that action at this time.
0 commit comments