- let
- mut
Number in a mutable variable
- You can make them mutable by adding the mut keyword to the declaration
examples/variables/mutable-number/src/main.rs
fn main() { let mut x = 2; println!("{}", x); x = 3; println!("{}", x); }
2 3
fn main() { let mut x = 2; println!("{}", x); x = 3; println!("{}", x); }
2 3