rustlings 0
Published at 2024/06/06
rustlings
Date: 2024/06/06
So far Iāve completed 29 of 96 exercises. Because my time on this has been sporadic, starting early December and continuing for a few exercises once a month, I expect to go through the exercises again in the future. Itās nice that Iāve done some of them.
tricky concept: ownership - exercise 30
? How does ownership work with pointers? example:
fn get_char(&data: String)
borrows data. Without the &
it does not. A function that takes ownership of an argument must have a non-borrowed argument.
note: function defined here
--> exercises/move_semantics/move_semantics6.rs:24:4
|
24 | fn string_uppercase(mut data: String) {
| ^^^^^^^^^^^^^^^^ ----------------
help: consider removing the borrow
|
15 - string_uppercase(&data);
15 + string_uppercase(data);
nice
Itās nice that ārustlings verifyā provides some detailed output. Try to make my own rust programs provide context when they fail. rustlings -h gets me some command documentation. Itās also satisfying to have a moment when the exercise is complete that I get to look at it - accomplished with the comment processing. To finish an exercise, I must change a comment āI AM NOT DONEā to āI AM DONEā - and then rustlings verify or rustlings watch will move on to the next exercise š.
questions
where do I get some documentation on my local system such as the rust book? Is it already here?
ooo resources!
āThe Rust Programming Languageā and āRust Programming By Exampleā are both books that I have on my system! Thanks, Humble Indie Bundle (rust edition! or maybe programming edition.)