1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-09-18 23:41:37 +02:00
rustlings/solutions/01_variables/variables4.rs
2024-05-21 02:43:18 +02:00

10 lines
234 B
Rust

fn main() {
// In Rust, variables are immutable by default.
// Adding the `mut` keyword after `let` makes the declared variable mutable.
let mut x = 3;
println!("Number {x}");
x = 5;
println!("Number {x}");
}