These are my solutions for the exercises as an intro
to the Rust language.
yay -Ss rust python3 # install cargo and python
cargo install --path # setup rustlings./install.sh
Then run rustlings
from the terminal to check the exercises.
Go to rustlings/exercises/<topic>
. A description for each topic is on the README.
rustlings watch
This will try to verify the completion of every exercise in a predetermined order (what we think is best for newcomers). It will also rerun automatically every time you change a file in the exercises/
directory. If you want to only run it once, you can use:
rustlings verify
This will do the same as watch, but it'll quit after running.
In case you want to go by your own order, or want to only verify a single exercise, you can run:
rustlings run myExercise1
Or simply use the following command to run the next unsolved exercise in the course:
rustlings run next
In case you get stuck, you can run the following command to get a hint for your exercise:
rustlings hint myExercise1
You can also get the hint for the next unsolved exercise with the following command:
rustlings hint next
To check your progress, you can run the following command:
rustlings list
After every couple of sections, there will be a quiz that'll test your knowledge on a bunch of sections at once. These quizzes are found in exercises/quizN.rs
.
Run the command rustlings lsp
which will generate a rust-project.json
at the root of the project, this allows rust-analyzer to parse each exercise.
Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to.
If you want to remove Rustlings from your system, there are two steps. First, you'll need to remove the exercises folder that the install script created for you:
rm -rf rustlings # or your custom folder name, if you chose and or renamed it
Second, since Rustlings got installed via cargo install
, it's only reasonable to assume that you can also remove it using Cargo, and
exactly that is the case. Run cargo uninstall
to remove the rustlings
binary:
cargo uninstall rustlings
Now you should be done!
See CONTRIBUTING.md.
Development-focused discussion about Rustlings happens in the rustlings stream on the Rust Project Zulip. Feel free to start a new thread there if you have ideas or suggestions!
Thanks goes to the wonderful people listed in AUTHORS.md 🎉