Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
Rust has the same culture as Go: opinionated tools, no debates. rustfmt formats to one canonical style. clippy lints across hundreds of rules. Configure both via rustfmt.toml and clippy.toml (sparingly), wire them into your editor on save and into CI as gating checks. A team that ships rustfmt+clippy from day 1 has clean diffs forever; a team that doesn't will rage-quit within months.
rustfmt and clippy are the two guardrails that keep Rust codebases consistent and idiomatic. rustfmt enforces a canonical style automatically — no debate, just run it. clippy is a static analysis linter that catches hundreds of common mistakes, performance anti-patterns, and non-idiomatic constructs that the compiler itself won't flag. Wiring both into your CI pipeline with --check flags means every pull request is verified to be formatted and lint-clean before it merges.
cargo fmt --all on the M1 hello project. If the diff is non-empty, you've found ungoverned formatting.cargo clippy -- -D warnings (the -D makes warnings hard errors). Fix every finding.rustfmt.toml setting max_width = 100 (or 80 — pick a side). Reformat. Note how cargo fmt is now project-aware.# format every file in the workspace (in place):
$ cargo fmt --all
# show what would change without writing:
$ cargo fmt --all -- --check
# clippy with strict gating — typical CI line:
$ cargo clippy --all-targets --all-features --workspace -- -D warnings
# config files (commit these):
$ cat rustfmt.toml
edition = "2021"
max_width = 100
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
$ cat clippy.toml
msrv = "1.75"
# avoid over-config; a few project-specific allows go inline.
# pre-commit hook (.git/hooks/pre-commit):
#!/bin/sh
cargo fmt --all -- --check && cargo clippy --all-targets -- -D warningscargo run