Skip to content

Add Chapter 0: Getting Started#6

Closed
hartsock wants to merge 3 commits into
ch02-error-handlingfrom
ch00-getting-started
Closed

Add Chapter 0: Getting Started#6
hartsock wants to merge 3 commits into
ch02-error-handlingfrom
ch00-getting-started

Conversation

@hartsock

Copy link
Copy Markdown
Member

Summary

  • Toolchain setup: rustup, cargo, side-by-side comparison with Python's pip/venv/pytest
  • Syntax basics: variables (let/let mut), functions, string formatting, if/else as expressions, Vec, HashMap, iterators
  • Cargo command cheat sheet with Python equivalents
  • Tone: "Yes, this is hello world. Bear with it — the point is the toolchain, not the program."
  • 11 passing example tests, 5 exercises (multiply, describe, fizzbuzz, double_all, summarize_scores)
  • Updates course README to include Ch0 in the table of contents

Test plan

  • cargo test -p ch00-getting-started — 11/11 pass
  • cargo clippy --workspace -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • No private repo references

Depends on #1

🤖 Generated with Claude Code

hartsock and others added 3 commits April 12, 2026 21:45
Maps Python's try/except/None to Rust's Result<T,E>, Option<T>, and the ?
operator. Covers custom error types, Option chaining, iterator collect into
Result, and the LBYL/EAFP/types comparison.

16 passing example tests, 5 exercises with todo!() stubs.

Also fixes ch01 Logger exercise: replaced todo!() in Drop impl with a
comment-only stub to avoid double-panic abort in the test runner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers rustup/cargo installation, side-by-side Python vs Rust syntax for
variables, functions, strings, control flow, collections, and iterators.
Includes a Cargo command cheat sheet mapping to Python equivalents.

11 passing example tests, 5 exercises (multiply, string format, fizzbuzz,
iterator map, and a score summarizer). Also adds Ch0 to the course README
table of contents.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old pipeline ran `cargo test --workspace` which fails because
exercise crates contain todo!() stubs that panic at runtime. That's
by design — students fill them in.

New pipeline has 5 jobs, all meaningful:

1. secrets-scan — gitleaks on full history
2. forbidden-patterns — grep for private infra leaks
3. lint — cargo fmt + clippy on entire workspace (exercises
   have #![allow] for expected warnings from stubs)
4. test-examples — run tests on chapter crates only (not exercises),
   using cargo metadata to discover crates dynamically
5. build-exercises — compile exercise test binaries without running
   them, catching type errors and broken scaffolding

Also adds rust-cache for faster CI runs and updates branch protection
to require all 5 jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hartsock
hartsock force-pushed the ch02-error-handling branch from 437d641 to 364de6d Compare April 13, 2026 23:55
@hartsock
hartsock deleted the branch ch02-error-handling April 13, 2026 23:56
@hartsock hartsock closed this Apr 13, 2026
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.

1 participant