Abstract
- A list of Rust syntax that worth noting
Rust Variable
Rust: Difference between Constant and Variable
const
can be used in the Global State(stored in the Data Segment), andlet
can only be used in a function(Stored in the Stack Segment)
Rust: Variable Shadowing
- Allowing us to reuse the same variable name, assign a different type of change the value (so we don’t need to think of a new variable name) of a Immutability variable (add in a degree of flexibility)
- Works on both
let
andlet mut
, but noconst
- Refer to Rust Variable Shadowing for more details