Concept Flow - Immutable variables
Declare variable with let
Variable is immutable by default
Try to change variable value
Compiler error: cannot assign to immutable variable
Use variable as is or declare mutable with let mut
In Rust, variables declared with let are immutable by default. Trying to change their value causes a compile error. To change a variable, declare it mutable with let mut.