Rust and Cargo 1 cheatsheet
Rust and Cargo 1: Build and run
8 common Rust and Cargo 1 tasks.
Type-check quickly
Check that the code compiles without producing a binary. Much faster than a build.
cargo check
Run with arguments
Pass arguments to your program after the double dash.
cargo run --release -- --port 8080
Show a backtrace on panic
Set RUST_BACKTRACE to see where a panic came from.
RUST_BACKTRACE=1 cargo run
Delete build output
Remove the target folder to free disk space or force a full rebuild.
cargo clean
Build and open documentation
Build the docs for your crate and its dependencies and open them in a browser.
cargo doc --open