Skip to content

Commit f35f63f

Browse files
Remove confusing aside in 23_conversions/from_str.rs
The advice tell us how to return as String error message. Unless I missed something, we can't even return a String error message here, so this advice is more confusing than anything and should better be removed.
1 parent 88b583f commit f35f63f

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

exercises/23_conversions/from_str.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ enum ParsePersonError {
4444
// 6. If while extracting the name and the age something goes wrong, an error
4545
// should be returned
4646
// If everything goes well, then return a Result of a Person object
47-
//
48-
// As an aside: `Box<dyn Error>` implements `From<&'_ str>`. This means that if
49-
// you want to return a string error message, you can do so via just using
50-
// return `Err("my error message".into())`.
5147

5248
impl FromStr for Person {
5349
type Err = ParsePersonError;

0 commit comments

Comments
 (0)