Skip to content

Instantly share code, notes, and snippets.

@doytsujin
Created November 11, 2022 05:30
Show Gist options
  • Save doytsujin/999e1e3d64134321b67a44758b730619 to your computer and use it in GitHub Desktop.
Save doytsujin/999e1e3d64134321b67a44758b730619 to your computer and use it in GitHub Desktop.
rust cli
rustup check # Check for updates to Rust toolchains and rustup
rustup component list # List installed and available components of the current Rust toolchain
rustup install stable
rustup default beta
rustup update # updating to the latest version
rustup toolchain list # list installed toolchains
rustup toolchain install stable-gnu # to install the GNU ABI (application binary interface)
cargo new [OPTIONS] <path>
# create a new Cargo package in the given directory;
# includes a simple template with a Cargo.toml manifest, sample source file, and a VCS ignore file
cargo check [OPTIONS]
# check a local package and all of its dependencies for errors; it does all compilation steps except for code generation.
# Some diagnostics and errors are only emitted during code generation, so "cargo check" can pass while "cargo build" may fail.
cargo test
cargo doc
cargo doc --open # builds documentation provided by all of your dependencies locally and opens it in your browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment