Add an optional rustlings-style runner#354
Open
leafyoung wants to merge 3 commits into
Open
Conversation
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.
There was a problem hiding this comment.
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
runnercrate with an interactive watch mode, progress tracking (.runner-state), and time-boundedcargo testexecution. - Added
runnerto the workspace and gitignored its state file. - Updated the intro chapter documentation to reference
runneralongsidewr.
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a small
runnerbinary 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 installwron the side. It's part of the workspace and runs withcargo run -p runner.$EDITOR)wris untouched. The intro chapter now points at both.Two things reviewers might care about: it adds
runnertomembersin the rootCargo.toml, and it pulls innotifyandlibcas deps. Happy to drop or rework any of it.