mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-03 01:09:18 +00:00
chore(from_str): Add hint's chunk from old try_from_into
This commit is contained in:
parent
5d342da6f9
commit
0b224b7bc6
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user