The bits that trip everyone up
None of these are hard. All of them stop people on day one, and all of them are a why rather than a rule to memorise.
Read this when something small will not compile and you cannot see what is wrong with it.
Articles
Section titled “Articles”- Why does Rust require the mut keyword?immutable by default, and why that is the useful choice
- Why would you shadow a variable instead of using mut?changing the type, not just the value
- What is the difference between const and static?inlined versus one address for the whole program
- How to return a value from a functionthe missing semicolon that returns nothing
- Why do both branches of an if need the same type?because if is an expression
- How to use the range syntax.. excludes the end, ..= does not
- How to break out of two nested loops at onceloop labels, and the return alternative
- How to iterate over an arrayby value, by reference, and mutably