The rustup installer and version management tool is the best way to download,
install, and maintain the rust programming environment. Using the rustup
command after installation will help you
check for updates and update your Rust environment when necessary.
Depending on your operating system, you can install rustup by following the
instructions below:
Enter the following command in terminal:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | shWe recommend working with the Windows Subsystem for Linux (WSL) to install Rust on Windows. Please follow the instructions from Microsoft.
Once you have WSL installed, open a WSL terminal and enter the following command:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | shUpdate existing Rust environment¶
You can run:
rustc --versionto both check if you already have Rust installed, and if so, which version. If you don’t have it installed, go above and follow the instructions to install it. If you already have a Rust environment installed, then you can update the version by doing:
rustup updateRustlings¶
Rustlings is a collection of small exercises designed to help you get familiar with reading and writing Rust code. Throughout this guide, you’ll find references to specific Rustlings exercises that complement the topics being discussed.
To install Rustlings, make sure you have Rust installed (see above), then run:
cargo install rustlingsOnce installed, initialize Rustlings in a directory of your choice (make sure it’s not in any of your course homework or project folders):
rustlings initThis will create a rustlings directory with all the exercises.
To start rustlings, simply enter the following command within the rustlings folder:
rustlings