This commit is contained in:
Andrew Dobrych 2021-08-11 11:24:54 +01:00
commit 42c79ea319
4 changed files with 4 additions and 8 deletions

View File

@ -20,7 +20,7 @@ struct Person {
// 4. Extract the first element from the split operation and use it as the name // 4. Extract the first element from the split operation and use it as the name
// 5. Extract the other element from the split operation and parse it into a `usize` as the age // 5. Extract the other element from the split operation and parse it into a `usize` as the age
// with something like `"4".parse::<usize>()` // with something like `"4".parse::<usize>()`
// 5. If while extracting the name and the age something goes wrong, an error should be returned // 6. If while extracting the name and the age something goes wrong, an error 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
impl FromStr for Person { impl FromStr for Person {

View File

@ -1,6 +1,6 @@
// move_semantics5.rs // move_semantics5.rs
// Make me compile without adding, removing, or changing any of the // Make me compile only be reordering the lines in `main()`, but without
// lines in `main()`. // adding, changing or removing any of them.
// Execute `rustlings hint move_semantics5` for hints :) // Execute `rustlings hint move_semantics5` for hints :)
// I AM NOT DONE // I AM NOT DONE

View File

@ -1,5 +1,4 @@
// iterators5.rs // iterators5.rs
// Let's define a simple model to track Rustlings exercise progress. Progress // Let's define a simple model to track Rustlings exercise progress. Progress
// will be modelled using a hash map. The name of the exercise is the key and // will be modelled using a hash map. The name of the exercise is the key and
// the progress is the value. Two counting functions were created to count the // the progress is the value. Two counting functions were created to count the

View File

@ -220,10 +220,7 @@ vogue. Does it help to update the value of referent (x) immediately after
the mutable reference is taken? Read more about 'Mutable References' the mutable reference is taken? Read more about 'Mutable References'
in the book's section References and Borrowing': in the book's section References and Borrowing':
https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references. https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references.
"""
Additional hint:
If you can't add, change, or remove any statements in `main()`, can you
reorder them in a way that lets the program compile?"""
# PRIMITIVE TYPES # PRIMITIVE TYPES