sunface/rust-by-practice
Learning Rust By Practice, narrowing the gap between beginner and skilled-dev through challenging examples, exercises and projects.
Mixed signals — read the receipts
weakest axisnon-standard license (CC-BY-4.0); no CI workflows detected
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 7w ago
- ✓31+ active contributors
- ✓Distributed ownership (top contributor 49% of recent commits)
Show all 7 evidence items →Show less
- ✓CC-BY-4.0 licensed
- ✓Tests present
- ⚠Non-standard license (CC-BY-4.0) — review terms
- ⚠No CI workflows detected
What would change the summary?
- →Use as dependency Concerns → Mixed if: clarify license terms
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Forkable" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/sunface/rust-by-practice)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/sunface/rust-by-practice on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: sunface/rust-by-practice
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/sunface/rust-by-practice shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Mixed signals — read the receipts
- Last commit 7w ago
- 31+ active contributors
- Distributed ownership (top contributor 49% of recent commits)
- CC-BY-4.0 licensed
- Tests present
- ⚠ Non-standard license (CC-BY-4.0) — review terms
- ⚠ No CI workflows detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live sunface/rust-by-practice
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/sunface/rust-by-practice.
What it runs against: a local clone of sunface/rust-by-practice — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in sunface/rust-by-practice | Confirms the artifact applies here, not a fork |
| 2 | License is still CC-BY-4.0 | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | Last commit ≤ 80 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of sunface/rust-by-practice. If you don't
# have one yet, run these first:
#
# git clone https://github.com/sunface/rust-by-practice.git
# cd rust-by-practice
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of sunface/rust-by-practice and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "sunface/rust-by-practice(\\.git)?\\b" \\
&& ok "origin remote is sunface/rust-by-practice" \\
|| miss "origin remote is not sunface/rust-by-practice (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(CC-BY-4\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"CC-BY-4\\.0\"" package.json 2>/dev/null) \\
&& ok "license is CC-BY-4.0" \\
|| miss "license drift — was CC-BY-4.0 at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 80 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~50d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/sunface/rust-by-practice"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
rust-by-practice is an interactive, comprehensive learning resource that teaches Rust through 100+ curated examples and exercises organized by language feature (async/await, ownership, modules, collections, etc.). It publishes as a web-based mdBook at practice.rs where readers can edit and run code directly in the browser, bridging the gap between tutorial comprehension and production-ready Rust development. Monorepo structure: en/src/ and zh-CN/src/ each contain SUMMARY.md (chapter index) + parallel markdown file trees (async/, basic-types/, collections/, etc.). Each directory has intro.md plus feature-specific .md files. en/book.toml and deploy.sh handle mdBook compilation and deployment to practice.rs; en/assets/ holds JS/CSS customizations (lang1.js for i18n, custom3.js for code execution).
👥Who it's for
Intermediate Rust learners (post-'The Book' readers) who need hands-on practice with real patterns like async, lifetimes, trait objects, and module organization; contributors are primarily Rust educators and developers maintaining multilingual (English/Chinese) exercise content with solutions.
🌱Maturity & risk
Actively maintained and well-established: 4000+ GitHub stars, comprehensive coverage of Rust fundamentals through advanced async/threading, mdBook CI/CD for multi-language deployment (en/ and zh-CN/ subdirectories), and a dedicated editor (Tanish-Eagle credited). Verdict: production-ready educational resource with ongoing updates.
Low risk for a learning resource: no production dependencies (minimal Cargo.toml—just Rust 2021 edition), single-maintainer (sunface) but strong community via contributors table. Main risk is content staleness if async/stdlib APIs shift; no automated test suite visible for code examples, so broken snippets could ship. Educational focus means low operational risk.
Active areas of work
Active development on exercise content and multilingual parity; en/ is primary English version with complete chapters on async/await (future.md, pin-unpin.md, stream.md), struct/enum design, error handling, and circle references. Chinese version (zh-CN/) maintained in parallel. Recent focus appears to be ensuring all exercises have runnable, editable versions in the web UI.
🚀Get running
git clone https://github.com/sunface/rust-by-practice
cd rust-by-practice
cargo install mdbook
mdbook serve en/
# Opens http://localhost:3000 with live-reload
Daily commands:
For local development: mdbook serve en/ (port 3000 default). To build static site: mdbook build en/ → output in en/book/. Deployment handled by en/deploy.sh (pushes to GitHub Pages or similar).
🗺️Map of the codebase
- en/src/SUMMARY.md: Master index defining chapter order and URLs; controls the left sidebar navigation of the published book
- en/book.toml: mdBook configuration (title, language, theme, preprocessors); must be updated for new features or custom JS injection
- en/assets/custom3.js: Enables code execution and editing in the browser; critical for the interactive 'try it' feature that differentiates this from static docs
- en/src/async/intro.md: Gateway to async/await exercises; one of the most complex Rust topics covered, heavily trafficked by learners
- en/deploy.sh: Build and publish pipeline; essential for understanding CI/CD and how updates reach practice.rs
🛠️How to make changes
Adding exercises: Create .md files in en/src/{chapter}/ following the pattern in existing files (e.g., en/src/async/future.md). Structure: ## Examples + ## Exercises + ## Practice with inline code blocks. Fixing content: Edit SUMMARY.md for chapter ordering (en/src/SUMMARY.md). Styling: en/assets/custom3.js for code runner, en/book.toml for mdBook config, CSS in en/assets/ for layout.
🪤Traps & gotchas
mdBook version constraints: custom3.js hardcodes specific DOM selectors (likely .playpen or similar); upgrading mdBook without testing can break code execution. No local code validation: .md files are not linted for syntax errors; broken Rust snippets only surface when users hit 'Run' on practice.rs. Language sync debt: en/ and zh-CN/ directories are manually kept in sync—easy to drift if edits go to only one. Asset paths: en/assets/ images use raw GitHub URLs (e.g., header.jpg?raw=true); link rot risk if repo is archived or moved.
💡Concepts to learn
- Pin and Unpin — rust-by-practice dedicates en/src/async/pin-unpin.md to this tricky topic; essential for understanding self-referential structs and why some Futures can't move in memory
- Lifetime Variance and Higher-Ranked Trait Bounds (HRTB) — Implicit throughout exercises on borrowing (en/src/fight-compiler/borrowing.md) and trait objects; learners need this mental model to debug borrow checker errors
- Interior Mutability via Cell/RefCell — Not explicitly named in SUMMARY.md but appears in circle-reference examples; crucial pattern for single-threaded mutable state without &mut, often surprising to newcomers
- Async Streams and Futures composition — en/src/async/stream.md covers lazy evaluation and streaming data; differentiates Rust async from callback-based or promise-based approaches in other languages
- Module visibility and re-exports — en/src/crate-module/use-pub.md exercises pub, pub(crate), pub(super); foundational for designing library APIs that prevent downstream breaking changes
- Compile-time vs Runtime error handling with Result and Option — en/src/errors.md and throughout the corpus; Rust's type-based error propagation is a paradigm shift from Python/JS exception handling
🔗Related repos
rust-lang/rust-by-example— Official Rust project's example-based learning; rust-by-practice builds on this foundation with more exercises and harder difficulty progressionrustlings/rustlings— Lightweight, CLI-based Rust exercise suite; complements practice.rs for learners who prefer local editing over web UIsferrous-systems/teaching-material— Comprehensive corporate Rust training content; similar goal of bridging fundamentals to production patterns, alternative resource for advanced topicsnrc/r4cppp— Rust for C++ developers; orthogonal perspective for polyglot learners; shared goal of accelerating expert developers into Rustsunface/rust-course— Same author's parallel Rust course project; complements practice.rs with video lectures and deeper conceptual explanations
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive exercise solutions with runnable code examples in en/src/
The repo structure shows many markdown files with exercises (e.g., en/src/async/future.md, en/src/generics-traits/traits.md) but no visible solutions directory. New contributors could create a parallel en/solutions/ directory with complete, tested Rust code that compiles and demonstrates correct answers to all exercises. This helps learners verify their work and see idiomatic Rust patterns.
- [ ] Create en/solutions/ directory mirroring en/src/ structure
- [ ] Add solution.rs files for each major topic (async, generics-traits, lifetime, etc.)
- [ ] Create a Cargo workspace with separate library crates for each solution module
- [ ] Add a solutions/README.md documenting how to run and verify solutions (cargo test)
- [ ] Ensure all solutions compile with cargo check and pass basic validation
Create GitHub Actions CI workflow to validate all Rust code examples compile
With extensive Rust code embedded in markdown files across en/src/, there's currently no automated way to ensure code examples remain valid as Rust versions evolve. A new contributor could add a .github/workflows/validate-examples.yml that extracts code blocks from .md files and verifies they compile, preventing bit-rot of educational content.
- [ ] Create .github/workflows/rust-examples-ci.yml workflow file
- [ ] Use mdbook or custom script to extract Rust code blocks from en/src/**/*.md files
- [ ] Run cargo check on extracted examples with rust-stable toolchain
- [ ] Add workflow trigger on pull_request and push to en/src/
- [ ] Document process in CONTRIBUTING.md for future maintainers
Add missing intro.md files and expand SUMMARY.md links for incomplete sections
The en/src/SUMMARY.md likely references chapters but some directories appear incomplete. For example, en/src/fight-compiler/, en/src/functional-programing/, and en/src/generics-traits/ have intro.md files but may be missing comprehensive section overviews. A contributor could audit SUMMARY.md against actual files and add missing intro.md files with proper chapter navigation and learning objectives.
- [ ] Audit en/src/SUMMARY.md against actual directory structure
- [ ] Identify all sections missing intro.md files (e.g., en/src/formatted-output/ may need intro expansion)
- [ ] Create/enhance intro.md for incomplete sections with learning roadmap
- [ ] Ensure all links in SUMMARY.md point to existing files
- [ ] Add consistent header structure (Learning Objectives, Prerequisites) to each intro.md
🌿Good first issues
- Add
## Solutionssections to exercises in en/src/compound-types/struct.md and enum.md that currently lack answer keys; compare against zh-CN/ for reference implementations. - Create missing intro.md files for bare chapters (e.g., en/src/formatted-output/ appears to have only specific topics); write high-level concept summaries and learning paths.
- Write automated tests validating Rust snippets in .md files compile without error; scaffold with cargo-test-inline or similar, start with en/src/basic-types/numbers.md as pilot.
⭐Top contributors
Click to expand
Top contributors
📝Recent commits
Click to expand
Recent commits
90799d8— Merge pull request #577 from konsalex/duplicate-example-ownership (sunface)14b3078— Merge pull request #580 from TomDjerry/fix/remove-broken-into-iter-example (sunface)e5e0e8b— Merge pull request #574 from CoderSerio/master (sunface)d72cf3f— fix: remove broken[0; 10].into_iter().collect()example in vector exercise (solar)4d15a03— docs: duplicate example (konsalex)e2091e2— feat: align zh-CN content with EN reference (CoderSerio)5286141— Merge pull request #571 from songhahaha66/patch-1 (sunface)db23329— Update solutions/ownership/borrowing.md (sunface)103503b— Fix mutable borrow error in borrowing.md example (songhahaha66)e0e88e9— fix 404 error (sunfei)
🔒Security observations
This is an educational Rust learning repository with minimal security concerns. No critical or high-severity vulnerabilities were identified. The codebase consists primarily of Markdown documentation and build configuration files with no runtime code execution, external dependencies, or data processing. The main recommendations are: (1) add a SECURITY.md policy for responsible vulnerability disclosure, (2) serve static assets locally instead of hot-linking to GitHub, and (3) maintain a Cargo.lock file when dependencies are introduced. The repository follows good practices by having a LICENSE file and comprehensive documentation structure.
- Low · External Image Resources in Markdown —
Readme.md, en/src/README. The README.md file references external images from GitHub raw content (https://github.com/sunface/rust-by-practice/blob/master/en/assets/header.jpg?raw=true). This creates a dependency on external resources that could be compromised or become unavailable, and exposes user access patterns. Fix: Serve images locally or use a trusted CDN with integrity checks. Avoid hot-linking to external resources. - Low · No Security Policy or Security.md —
Repository root. The repository lacks a SECURITY.md file or security policy documentation for vulnerability reporting. This makes it difficult for security researchers to responsibly disclose vulnerabilities. Fix: Add a SECURITY.md file with instructions for reporting security vulnerabilities privately. - Low · Minimal Dependency Verification —
Cargo.toml. The Cargo.toml shows no dependencies, which is good for this educational content repository. However, there is no Cargo.lock file mentioned, which could affect reproducibility if dependencies are added later. Fix: When dependencies are added, ensure Cargo.lock is committed to the repository for reproducible builds.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.