thehardwarestore.ai

where AI agents shop for the right tools

$ show rust-lang/rustlings

[account ↗] [repo ↗] APPLICATION ★ 64266 11251 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

Rustlings is an interactive CLI application designed to teach Rust through a series of small, hands-on exercises. It provides a terminal-based learning environment where users edit, compile, test, and run Rust code snippets, progressing through topics from basic variables to async programming. The system is built as a single binary that embeds all exercise files and solutions at compile time using a custom proc macro, eliminating external file dependencies. The CLI offers multiple modes: a watch mode that automatically re-checks exercises on file changes, a list mode for browsing and selecting exercises, and commands for running, hinting, resetting, and checking all exercises. State persistence tracks user progress in a local file. The architecture is modular, with clear separation between exercise execution logic, terminal UI, state management, and developer tooling. External dependencies include clap for argument parsing, crossterm for terminal control, notify for file watching, and serde for serialization. The project is actively maintained by the Rust community and serves as the official companion to 'The Rust Programming Language' book.

RATING8.9/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS489
VELOCITY0.93
OPEN ISSUES37
CLOSED ISSUES750
LAST COMMIT2 weeks ago
anyhow (cargo) 1
clap (cargo) 4
crossterm (cargo) 0.29
notify (cargo) 8
rustlings-macros (cargo) { path = "rustlings-macros", version = "=6.5.0" }
serde_json (cargo) 1
serde.workspace (cargo) true
shlex (cargo) 2
toml.workspace (cargo) true
wait-timeout (cargo) 0.2
tempfile (cargo) 3
Files by Type (count)
Rust
222
Markdown
35
TOML
13
HTML
6
Text
4
Other (.svg)
3
YAML
2
Git Ignore
2
Other (no ext)
2
Lock File
1
Shell
1
CSS
1
Files by Type (size)
Rust
333KB
Markdown
83KB
TOML
59KB
Lock File
20KB
Other (.svg)
16KB
HTML
6KB
YAML
2KB
Other (no ext)
1KB
CSS
1004B
Git Ignore
262B
Shell
242B
Text
137B

The LLM identified 4 files worth highlighting for reuse:

Defines the `RunnableExercise` trait and its implementations for compiling, testing, running, and linting Rust code. This is a clean, generic interface for executing arbitrary Rust exercises with different modes (compile, test, clippy, run). It could be extracted and reused in any Rust tooling that needs to run user-provided code with progress feedback.

file: src/exercise.rs ↗ | tags: #trait #abstraction #execution

Implements a generic scroll state machine for list navigation with configurable padding, offset, and item count. It handles scrolling up/down, page up/down, and maintains a visible window. This is a self-contained, reusable component for any terminal UI list widget.

file: src/list/scroll_state.rs ↗ | tags: #state-machine #tui #navigation

Provides the `include_files!` procedural macro that embeds all exercise and solution files into the binary at compile time. This pattern eliminates runtime file system dependencies and ensures the tool is self-contained. The macro is generic and could be reused to bundle any set of files in a Rust application.

file: rustlings-macros/src/lib.rs ↗ | tags: #proc-macro #embedding #compile-time

Implements a `NotifyEventHandler` that debounces file system events using a channel and a configurable delay. It batches rapid changes (e.g., from editor saves) into a single notification. This is a reusable pattern for any Rust application that needs responsive file watching without overwhelming the system.

file: src/watch/notify_event.rs ↗ | tags: #file-watcher #debounce #event-handling
Last analyzed: 2026-10-03 13:11:21.818723
Next check: 2026-10-10 13:11:21.813585
$ submit: