There are two types that don't use
let to declare:
static. Also, Rust won't use type inference: you need to write the type for them. These are for variables that don't change (
const means constant). The difference is that:
constis a value that does not change,
staticis a value that does not change and has a fixed memory location.
So they are almost the same. Rust programmers almost always use
You write them with ALL CAPITAL LETTERS, and usually outside of
main so that they can live for the whole program.
Two examples are:
const NUMBER_OF_MONTHS: u32 = 12; and
static SEASONS: [&str; 4] = ["Spring", "Summer", "Fall", "Winter"];