Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Installation

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:

Linux or macOS
Windows

Enter the following command in terminal:

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Update existing Rust environment

You can run:

rustc --version

to 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 update

Rustlings

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 rustlings

Once installed, initialize Rustlings in a directory of your choice (make sure it’s not in any of your course homework or project folders):

rustlings init

This will create a rustlings directory with all the exercises.

To start rustlings, simply enter the following command within the rustlings folder:

rustlings