rust handy commands
Rust Handy Commands
Cargo Commands
# Create new project
cargo new project_name
# Build project
cargo build
# Build for release
cargo build --release
# Run project
cargo run
# Run tests
cargo test
# Check code without building
cargo check
# Format code
cargo fmt
# Run linter
cargo clippy
Common Patterns
Pattern Matching
match value {
Some(x) => println!("{}", x),
None => println!("nothing"),
}
Error Handling
let result = operation()?;