Basics
Variables
Use let for a local value and let mut if it needs to change.
fn main() -> i32 {
let base = 40;
let mut count = base;
count = count + 2;
return count;
}terminal
hopper run demo src
Whole numbers and booleans copy. Assigning a struct or an array to another variable moves it; use a reference when a function should borrow it instead.