mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 00:00:03 +03:00
Merge f35f63fa57
into 8d0aa11a35
This commit is contained in:
commit
817f7cf859
|
@ -44,10 +44,6 @@ enum ParsePersonError {
|
||||||
// 6. If while extracting the name and the age something goes wrong, an error
|
// 6. If while extracting the name and the age something goes wrong, an error
|
||||||
// should be returned
|
// should be returned
|
||||||
// If everything goes well, then return a Result of a Person object
|
// If everything goes well, then return a Result of a Person object
|
||||||
//
|
|
||||||
// As an aside: `Box<dyn Error>` implements `From<&'_ str>`. This means that if
|
|
||||||
// you want to return a string error message, you can do so via just using
|
|
||||||
// return `Err("my error message".into())`.
|
|
||||||
|
|
||||||
impl FromStr for Person {
|
impl FromStr for Person {
|
||||||
type Err = ParsePersonError;
|
type Err = ParsePersonError;
|
||||||
|
|
Loading…
Reference in a new issue