3 ms·
One thing you've missed here is that `let mut` is two different things: `let` is the keyword for creating a new binding, while `mut` is part of the pattern that
by Measter 4y ago
One thing you've missed here is that `let mut` is two different things: `let` is the keyword for creating a new binding, while `mut` is part of the pattern that `let` binds to. For example, you can pattern match a tuple and make one value `mut` and the other not:
let (a, mut b) = //some tuple
You can't just replace `let mut` with `var` because it changes the semantics of the code.