Skip to content

Add an optional rustlings-style runner#354

Open
leafyoung wants to merge 3 commits into
mainmatter:mainfrom
leafyoung:rustling-like
Open

Add an optional rustlings-style runner#354
leafyoung wants to merge 3 commits into
mainmatter:mainfrom
leafyoung:rustling-like

Conversation

@leafyoung

@leafyoung leafyoung commented Jul 21, 2026

Copy link
Copy Markdown

This adds a small runner binary that steps through the exercises one at a time, a bit like rustlings. The learning experience is more smooth with automatic build and test and you don't have to install wr on the side. It's part of the workspace and runs with cargo run -p runner.

  • runs the current exercise's tests, moves on when they pass
  • re-runs on save; keys are r / n / h / l / q
  • opens the current file in your editor (VS Code, or $EDITOR)
  • kills a stuck test after 10s — the futures blocking exercise hangs forever otherwise

wr is untouched. The intro chapter now points at both.

Two things reviewers might care about: it adds runner to members in the root Cargo.toml, and it pulls in notify and libc as deps. Happy to drop or rework any of it.

Bundles a `runner` binary (`cargo run -p runner`) that walks the exercises one by one: watch mode with auto-advance, file-change re-run, raw-mode keys (r/n/h/l/q), editor auto-open, and a 10s kill timeout for hung tests. The book now documents both `wr` and `runner` as ways to verify solutions.
Copilot AI review requested due to automatic review settings July 21, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new runner workspace binary to guide users through the exercises sequentially (rustlings-style), and updates the book to mention it as an alternative to wr.

Changes:

  • Added a new runner crate with an interactive watch mode, progress tracking (.runner-state), and time-bounded cargo test execution.
  • Added runner to the workspace and gitignored its state file.
  • Updated the intro chapter documentation to reference runner alongside wr.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
runner/src/main.rs Implements the interactive runner, exercise discovery/state, watch mode, and timed test execution.
runner/Cargo.toml Defines the new runner crate and its dependencies (anyhow, notify, libc).
Cargo.toml Adds runner to the workspace members list.
Cargo.lock Adds runner dependencies and updates lockfile contents.
book/src/01_intro/01_syntax.md Updates intro text to reference both wr and the new bundled runner.
book/src/01_intro/00_welcome.md Adds a new “Verifying your solutions” section describing both wr and runner.
.gitignore Ignores .runner-state progress file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread runner/src/main.rs Outdated
Comment thread runner/src/main.rs Outdated
Comment thread runner/src/main.rs Outdated
Comment thread book/src/01_intro/00_welcome.md
leafyoung and others added 2 commits July 22, 2026 08:56
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- forward every keypress (not just r/n/h/l/q), so "press any key to return" from the list is actually true
- stop draining the whole event channel on a file change; coalesce only file events and keep queued key events
- run cargo directly instead of shelling out to sh, so it works without a POSIX shell
- note in the book that watch mode is macOS/Linux only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants