Zmh's blog

Rust Toolchain Cheat Sheet

created: 2026-03-08T22:46:00+08:00updated: 2026-03-08T22:46:00+08:00topic: programming/ruststatus: evergreen#rust#cargo#rustup#clippy#fmt

Rust Toolchain Cheat Sheet

rustup

  • rustup update
  • rustup toolchain list
  • rustup default stable
  • rustup component add clippy rustfmt rust-docs
  • rustup target add <target-triple>

cargo

  • cargo new <name>
  • cargo check
  • cargo run
  • cargo test
  • cargo fmt
  • cargo clippy --all-targets --all-features
  • cargo doc --open
  • cargo fix --edition

Practical Defaults

  • Run cargo check before every logical save point.
  • Use cargo clippy before commit.
  • Keep one workspace for related binaries and shared crates.

References

On this page