# Rust ## Update Rust ```bash rustup update ``` ## Printing with Placeholders `println!` uses `{}` as placeholders, filled left-to-right from the argument list: ```rust println!("x = {}, y = {}", x, y); ``` ([source](https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html)) ## Variable Shadowing Rust allows re-declaring a variable with the same name, which **shadows** the previous binding. Useful for transforming a value without needing separate names like `guess_str` and `guess`: ```rust let guess: String = String::new(); let guess: u32 = guess.trim().parse().expect("Not a number"); ``` ([source](https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html)) --- ## Related Notes | Note | Description | |------|-------------| | [[Cargo]] | Package manager and build system | | [[cargo-deny]] | Dependency graph linter | | [[Crates Ecosystem]] | Popular Rust tools and crates |