This document explains how Rustlings exercises are organized to teach Rust concepts in a progressive manner. It covers the exercise ordering, topic progression, and how exercises map to chapters in "The Rust Book". For information about the format and structure of individual exercises, see Exercise Definition.
Rustlings organizes exercises by topic in the exercises/ directory, with each topic having its own subdirectory. The topics follow a pedagogical progression from foundational concepts to more advanced Rust features. This ordering is strictly defined in the info.toml file, which the application uses to determine the "next" exercise.
Sources: rustlings-macros/info.toml30-1010
Each exercise set in Rustlings corresponds to specific chapters in "The Rust Book". This alignment allows users to work through exercises while reading the corresponding book chapters for deeper understanding. The hints often include direct links to relevant book sections.
Sources: rustlings-macros/info.toml112-115 rustlings-macros/info.toml132-134
The complete mapping between exercise topics and book chapters is detailed in the table below:
The exercises increase in complexity as users progress through the topics, with a natural difficulty progression built into the ordering.
Sources: rustlings-macros/info.toml30-1010
Each topic directory contains multiple exercises that provide incremental learning of the concept. For example, in 01_variables, the exercises progress from basic binding to mutability and finally shadowing.
Sources: rustlings-macros/info.toml51-134
Within each topic, the exercises typically follow this progression:
intro1.rs which just requires the user to enter n). exercises/00_intro/intro1.rs8-24variables1.rs missing let). exercises/01_variables/variables1.rs1-10move_semantics4.rs). exercises/06_move_semantics/move_semantics4.rs7-17From for complex conversions (e.g., conversions2.rs). exercises/23_conversions/conversions2.rs13-20Quizzes serve as checkpoints that aggregate multiple concepts. For instance, quiz1.rs tests Variables, Functions, and If statements exercises/quizzes/quiz1.rs1-4 while quiz2.rs covers Strings, Vecs, Move Semantics, Modules, and Enums exercises/quizzes/quiz2.rs1-6
The Watch Mode in Rustlings guides users through exercises in the sequence defined in info.toml.
Sources: rustlings-macros/info.toml3-28
The tool tracks completion based on the status of exercises defined in info.toml. When an exercise passes, the user is prompted to move to the next one using the n command rustlings-macros/info.toml37-39
Sources: rustlings-macros/info.toml8-16
The exercise progression in Rustlings is a curated path through the Rust language. By strictly ordering exercises in info.toml and mapping them to "The Rust Book", the system provides a structured environment where each success builds the foundation for the next challenge.