Rustlings: A Rust Exercise Runner You Install Through Cargo
Rustlings offers small hands-on exercises that teach you to read and write Rust code, designed to be worked through alongside the official Rust book.
At a glance
- What is it?
- Rustlings is a command line exercise runner for people reading the official Rust book. It is installed with a single Cargo command, and its exercise set is the part that decides whether it fits you.
- Who is it for?
- Adopt Rustlings if you are working through the official Rust book and want a graded set of small files to fix, and if you can run the current toolchain: the workspace pins rust-version 1.88 and edition 2024. Skip it if you want a browser playground or video course, or if you already write Rust and need project-scale practice, because the exercises are deliberately small and the README points to the website for setup rather than documenting it in the repository.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What Rustlings Is For, and What It Is Not
Rustlings is a set of small exercises plus a binary that watches you solve them. The README describes it as "Small exercises to get you used to reading and writing Rust code" and recommends it "in parallel to reading the official Rust book". That sentence is the whole scope. It is a companion to a book, not a replacement for one.
The intended user is someone who has just read a chapter about ownership, borrowing, or error handling and wants to type Rust immediately. The exercise files are the material; the runner only tracks which ones fail and which ones pass. If you are looking for a project to build, a web framework tutorial, or an explanation of why the borrow checker rejects a specific line, Rustlings is the wrong shape of tool. It gives you broken files and a pass or fail signal, and the explanation has to come from somewhere else, normally the book you are reading next to it.
How the Exercise Runner Watches Your Files
The mechanism is a file watcher, not a test harness you invoke by hand. The Cargo.toml lists notify as a dependency, and the runner uses it to react when you save an exercise file. The README does not spell out the loop, but the dependency list and the exercise layout make the shape clear: the binary reads the exercise set, presents the current one, waits for a change on disk, recompiles or rechecks that exercise, and advances when it passes.
Exercise metadata is not hand-parsed. The workspace depends on serde and toml, and rustlings-macros is a path dependency pinned with version = "=6.5.0". That macro crate is how exercise information is embedded at build time, which is why the binary can know the order and identity of exercises without scanning a config file at startup. On non-Windows targets the dependency list includes rustix with the termios feature, so terminal input is handled directly rather than through a portable abstraction. The runner is a local, terminal-first program. It does not phone home, it does not need a browser, and it does not ship a server component.
Installing Rustlings and Running the First Exercise
The README does not contain installation commands. It points to rustlings.rust-lang.org for "a demo, info about setup and more", so the steps below should be checked against that page rather than treated as the canonical source. What the repository does establish is the package name, which is rustlings, and the binary it produces, which is the same name.
The Cargo.toml sets rust-version = "1.88" and edition = "2024" for the workspace. A toolchain older than 1.88 will not build it, and edition 2024 means the exercises themselves assume a recent compiler. Check that first, then install from crates.io:
rustc --version
cargo install rustlingsAfter the install finishes, the binary is on your PATH. The runner needs a directory of exercises to work in, and the repository keeps them under exercises/, so the first real step is creating a working copy:
rustlings init
cd rustlings
rustlingsWhat you should see is a terminal listing with the first unfinished exercise selected, and a prompt to edit a file. Open that file, fix the compile error or the failing assertion, save, and the watcher picks up the change without you rerunning anything. If rustlings init is not a subcommand in your installed version, run rustlings --help and use whatever the binary lists; the README is silent on the exact subcommand set, so the binary is the authority on your machine.
The Version Pin and the Edition Are Real Constraints
Two facts in Cargo.toml will decide whether Rustlings works for you before you write any code. The workspace sets edition = "2024" and rust-version = "1.88". A distribution toolchain, a long-term-support release, or a pinned CI image older than that will fail at build time, and the failure will look like a compiler error rather than a Rustlings error. That is a normal cost for a teaching project that wants to demonstrate current syntax, but it is a cost.
The second constraint is the exercise set itself. The repository ships exercises/ and solutions/ side by side, and the package include list in Cargo.toml names both directories plus src/, README.md, and LICENSE. Solutions are therefore present in the published crate. That is convenient when you are stuck and demoralising when you are not: the answer to the exercise you are staring at is a directory away. Nothing in the repository says the runner hides them. If you want the struggle to be real, do not open that directory, because the tool will not stop you.
The release history is worth reading as a signal rather than a score. The last push to the default branch was on 2025-08-21, which is also the date of the v6.5.0 release. The gap before that was from v6.4.0 on 2024-11-11 to v6.5.0, so roughly nine months between releases. This is a mature, slow-moving project, not one that will chase your compiler version every week. Do not expect the exercise set to track every new language feature promptly.
Rustlings Compared with Rust by Example and the Book
The honest alternative is not another exercise runner. It is the two resources the Rust project already publishes. The official Rust book explains concepts in prose and builds toward a small project; you read it, and you get no pass or fail signal. Rust by Example takes the opposite approach and presents annotated, runnable snippets organised by topic. Neither one watches your files or tells you that exercise three now compiles.
That difference is the entire value proposition of Rustlings. It converts reading into a sequence of small, checkable edits. The trade-off is that the feedback is binary and shallow: the runner knows whether the file compiles and whether its assertions hold, not whether your solution is idiomatic. A solution that passes can still be the wrong way to write Rust, and the shipped solutions/ directory is the only reference the repository gives you for comparison. If you learn better from complete worked programs than from broken fragments, Rust by Example will fit you better, and the README's own recommendation of the book suggests the project sees itself as a supplement rather than a standalone course.
Licence and What Upgrading Costs You
The workspace declares license = "MIT" and ships a LICENSE file at the repository root. The package include list in Cargo.toml confirms that LICENSE is part of the published crate. That is a permissive licence, and it means you can read, copy, and adapt the exercises. It does not mean the exercises are yours to relicense as a proprietary product, and it says nothing about the Rust book or the website, which are separate works with their own terms. Check those separately; this article is not legal advice.
Upgrade cost is low but not zero. The runner is a single binary installed through cargo install, so updating means reinstalling and running the init step again in a fresh directory. Because the exercise set is versioned with the binary, a newer Rustlings can add or reorder exercises, and your progress lives in the working directory you created, not inside the binary. The practical consequence is that a mid-course upgrade can leave you with two directories at different exercise versions. Finish a pass before you upgrade, or expect to reconcile the two.
Editorial conclusion
Adopt Rustlings if you are working through the official Rust book and want a graded set of small files to fix, and if you can run the current toolchain: the workspace pins rust-version 1.88 and edition 2024. Skip it if you want a browser playground or video course, or if you already write Rust and need project-scale practice, because the exercises are deliberately small and the README points to the website for setup rather than documenting it in the repository. Before committing, run rustlings --help on your machine to confirm the subcommands your build exposes, and read exercises/ to see whether the topics match what you are reading.
Frequently asked questions
How do I install Rustlings?
The README does not list install commands and points to rustlings.rust-lang.org for setup information. The package name is rustlings, so the crates.io route is cargo install rustlings, followed by the init step in a working directory. Confirm the exact subcommands with rustlings --help on your machine.
What is Rustlings?
It is a set of small Rust exercises plus a command line runner that watches the files you edit and advances when an exercise passes. The README describes it as exercises to get you used to reading and writing Rust code, recommended alongside the official Rust book.
How do I use Rustlings?
Create a working copy of the exercises, then run the rustlings binary in that directory. It presents the current exercise, you edit the file until it compiles and its assertions hold, and the file watcher moves you to the next one without a manual rerun.
Is Rustlings a good way to learn Rust?
It is a good companion to the official Rust book, which the README recommends reading in parallel, because it turns reading into small checkable edits. It does not explain concepts on its own, and passing an exercise does not prove your solution is idiomatic, so pair it with prose material.
What is an alternative to Rustlings?
Rust by Example covers similar ground with annotated, runnable snippets organised by topic instead of broken files you repair. The difference is the feedback loop: Rust by Example shows you working code, while Rustlings tells you whether your edit compiles and passes.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/rust-lang-rustlings)
Community notes