opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Small exercises to get you writing Rust alongside the official book
GitHub RepoImpressions2

Project Description

View on GitHub

Learn Rust by Fixing Broken Code: An Honest Look at Rustlings

You've read the Rust book, nodded along with the chapters on ownership and borrowing, and then closed your laptop feeling like you understand... something. But when you sit down to actually write Rust, you freeze. The compiler screams at you about lifetimes, and you're not even sure what question to ask. That gap between reading and doing is exactly where Rustlings comes in—a collection of small exercises designed to get you writing real Rust code while you work through the official book.

What It Does

Rustlings is a set of small, focused exercises that teach you to read and write Rust by giving you broken code to fix. It's maintained under the rust-lang organization on GitHub, which tells you something about its credibility—this isn't a random side project, it's part of the official Rust ecosystem.

The core idea is simple: each exercise presents you with a Rust file that has intentional errors or missing pieces. Your job is to get it to compile and pass whatever tests are embedded in the exercise. The exercises are designed to be done in parallel with reading The Rust Book, so you're not learning in a vacuum—you're reinforcing each chapter's concepts with hands-on practice.

The setup is straightforward. You install Rustlings, run a command that starts an interactive session, and it walks you through exercises one by one. The project also has a companion website at rustlings.rust-lang.org where you can see a demo and find setup instructions, so you know what you're getting into before you commit to installing anything.

Why It's Cool

What makes Rustlings genuinely effective is the design philosophy baked into its structure:

It's active learning, not passive reading. Most tutorials show you correct code and explain why it works. Rustlings flips that—it gives you broken code and forces you to figure out why it's broken. That's how you actually build intuition for a language's rules. You'll fight with the borrow checker in a controlled environment where the exercise is small enough to understand completely, rather than debugging a 1,000-line project where you can't tell if the problem is your code or your architecture.

It pairs perfectly with the official book. The README explicitly recommends using Rustlings alongside the Rust Book, not instead of it. That's a smart choice. The book gives you the conceptual framework; Rustlings gives you the muscle memory. And because the exercises are small, you can knock out a couple in fifteen minutes and feel like you've made concrete progress.

The exercises are curated by people who know Rust deeply. Being under the rust-lang umbrella means the exercises reflect what the language maintainers think matters. You're not learning someone's idiosyncratic interpretation of Rust—you're learning the patterns and concepts that the people building the language consider essential.

It's honest about the learning curve. Rust has a reputation for being hard, and a lot of that difficulty comes from the compiler being strict in ways other languages aren't. Rustlings doesn't try to hide that or sugarcoat it. Instead, it gives you a safe space to make mistakes, read the compiler's error messages, and gradually internalize why Rust demands what it demands.

How to Try It

Getting started is straightforward. Head over to the repository at github.com/rust-lang/rustlings, and you'll find installation instructions in the README. The project also maintains a website at rustlings.rust-lang.org with a demo and setup details.

The typical workflow looks something like this:

  1. Install Rust if you haven't already (you'll need rustup and cargo).
  2. Clone the repository or install Rustlings via the method specified in the README.
  3. Run the rustlings command to start the interactive exercise runner.
  4. Work through exercises in order, fixing each file until it compiles and passes.
  5. Use rustlings next to move to the next exercise when you're ready.

The exercises are numbered and progress in difficulty, so you're not thrown into advanced concepts before you've mastered the basics. And since it's designed to run alongside the book, you can sync up each exercise with the relevant chapter.

Final Thoughts

Rustlings is best for people who've started reading the Rust Book and realized that understanding isn't the same as doing. It's not a replacement for building real projects—nothing is—but it's an excellent bridge between theory and practice. The exercises are small enough to not feel overwhelming, but substantial enough that completing them genuinely builds confidence.

The fact that it's maintained under the rust-lang organization means it stays current with language changes and reflects best practices as they evolve. If you're learning Rust and you've hit that frustrating plateau where you understand the concepts but can't write code that compiles, give Rustlings a shot. It won't make the borrow checker your friend overnight, but it'll give you a structured way to build that relationship—one broken exercise at a time.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 53f82a9c-f0be-48d5-9db2-9b28dff98ffaLast updated: September 6, 2026 at 04:12 AM