Guide · Open source
How to use rustlings: install, work the exercises and tips
Updated · written with AI from the project's own documentation and checked against our catalogue data
Rustlings is an open-source (MIT-licensed) set of small Rust exercises from the rust-lang organisation. Each exercise is a piece of code you fix so it compiles and runs, which builds familiarity with reading and writing Rust. This guide explains what it is, how to get the repository, how to work through the exercises, and when it is the right tool.
Quick start
- 1Check your fit. Confirm that you are learning Rust and want guided exercises, not production tooling.
- 2Clone the repository. Run git clone https://github.com/rust-lang/rustlings to get the exercises on your machine.
- 3Open the website. Visit rustlings.rust-lang.org for the demo and setup information.
- 4Start with the first exercise. Read the code, then fix it so it compiles and runs.
- 5Read the matching chapter. Open the official Rust book chapter that covers the concept you are practising.
- 6Move through the list in order. Work one exercise at a time, moving on once each one passes.
What is rustlings and who is it for?
Rustlings is a set of small practice exercises for the Rust programming language. You work through them one at a time, fixing code so it compiles and runs.
The project's README describes it as recommended alongside the official Rust book. It is best suited to people learning Rust for the first time, readers of the Rust book who want hands-on practice, and developers who learn better by fixing small pieces of code.
It is not a production tool. The README describes it only as a learning aid, and it is not a reference guide.
- Good fit: first-time Rust learners and book readers who want practice.
- Poor fit: experienced Rust developers looking for production tools, or readers who want a reference guide rather than guided exercises.
Get the rustlings repository
The source README lists a single install step: clone the repository from GitHub. The project's homepage at rustlings.rust-lang.org has a demo and setup information. The source does not list any prerequisites, so check the website for setup details before you start.
git clone https://github.com/rust-lang/rustlingsWork through the exercises
Rustlings exercises are meant to be done one at a time. Open an exercise, read the code, fix it so it compiles and runs, then move to the next. The source README does not describe the exact command-line workflow, so follow the instructions on the official website for running and checking exercises.
Keep the Rust book open alongside the exercises. The README recommends using the two in parallel, so the book can explain the concept behind each exercise.
- Read the exercise code before changing anything.
- Make the smallest change that lets the code compile and run.
- Use the official Rust book for explanations of the concepts you are practising.
Compare rustlings with similar projects
Rustlings is not the only way to practise Rust. The comparable projects named for this item are Rust by Example and the Exercism Rust track. Rust by Example is useful when you want short runnable examples of language features. Exercism offers a structured Rust track with its own exercises.
Rustlings focuses on fixing small broken or incomplete code. If you prefer reading example programs, pick Rust by Example. If you prefer a guided course with its own platform, consider Exercism.
What people use it for
- Learning Rust syntax by fixing small compile errors
- Practising alongside the official Rust book chapter by chapter
- Building reading skills by inspecting code you did not write
- Warming up on Rust concepts before starting a real project
Frequently asked questions
Is rustlings free?
Yes. The project is published under the MIT licence, and the repository is on GitHub at rust-lang/rustlings. Check the licence file in the repository for the full terms.
How do I install rustlings?
The source README lists one install step: clone the repository with git clone https://github.com/rust-lang/rustlings. Setup details are on the official website at rustlings.rust-lang.org.
What do I need before using rustlings?
The source does not list any prerequisites. Check the official website for setup information before you begin.
Should I use rustlings with the Rust book?
Yes. The README recommends using rustlings in parallel with the official Rust book, which explains the concepts behind each exercise.
Is rustlings good for experienced Rust developers?
Not really. The README describes it only as a learning aid, so experienced developers looking for production tools should look elsewhere.
How does rustlings compare to Rust by Example or Exercism?
Rustlings asks you to fix small pieces of code. Rust by Example offers short runnable examples of language features, and the Exercism Rust track offers a structured set of Rust exercises.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Rustlings suits people learning Rust for the first time, or anyone reading the official Rust book who wants hands-on fixing practice. If you are an experienced Rust developer or need a reference guide, pick Rust by Example for examples or another tool for production work.
Install options & downloads