Repolode
origin-brain

origin-brain/rust-by-practice

A free, open-source collection of Rust exercises and examples, organized by chapter with runnable, editable code and solutions.

Stars
14,807
Forks
1,203
Open issues
67
Last commit
2 months ago

What is it?

Rust By Practice is an mdBook-based learning resource that teaches Rust through hands-on exercises rather than prose alone. Each chapter is split into examples, exercises, and practice problems, and the goal is to make each exercise compile without errors or panics.

The content covers a wide range of Rust topics, including async/await, threads, synchronization primitives, optimization, the standard library, the toolchain, and data structures and algorithms. Exercises are graded from easy to super hard, and every exercise comes with its own solution. Part of the material is adapted from Rust By Example.

The book is available in English and Simplified Chinese, and can be read online or built locally with mdBook.

Key features

  • 01Chapters split into examples, exercises, and practice problems
  • 02Exercises can be read, edited, and run online
  • 03Every exercise includes a solution
  • 04Difficulty graded from easy to super hard
  • 05Available in English and Simplified Chinese

Use cases

  • Moving from reading Rust basics to writing real code
  • Practicing async, threads, and synchronization after learning the language
  • Preparing for interviews with algorithm and data structure exercises in Rust
  • Teaching or self-studying Rust with a structured set of exercises

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/sunface/rust-by-practice
  2. 2

    Install mdbook using Cargo

    cargo install mdbook
  3. 3

    Serve the English book locally

    cd rust-by-practice && mdbook serve en/

Things to know

  • The exercises are delivered as a book built with mdbook, not as a runnable software project.

Topics

FAQ

What is rust-by-practice?
A free, open-source collection of Rust exercises and examples, organized by chapter with runnable, editable code and solutions. Rust By Practice is an mdBook-based learning resource that teaches Rust through hands-on exercises rather than prose alone. Each chapter is split into examples, exercises, and practice problems, and the goal is to make each exercise compile without errors or panics.
Is rust-by-practice free to use? What license does it have?
rust-by-practice is open source under the CC-BY-4.0 license. Check the license terms before using it in commercial products.
Is rust-by-practice still maintained?
Updated within 6 months. The last commit to rust-by-practice was on Aug 24, 2026.
What can I use rust-by-practice for?
Moving from reading Rust basics to writing real code Practicing async, threads, and synchronization after learning the language Preparing for interviews with algorithm and data structure exercises in Rust Teaching or self-studying Rust with a structured set of exercises
How do I install rust-by-practice?
Clone the repository: git clone https://github.com/sunface/rust-by-practice Install mdbook using Cargo: cargo install mdbook Serve the English book locally: cd rust-by-practice && mdbook serve en/
Where can I get rust-by-practice?
The source code and installation instructions are on GitHub: https://github.com/origin-brain/rust-by-practice

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects