2 ms·
I've done a fair bit of rust development and never found that to be an issue. It probably helps that the only ways to introduce new variables are all very dist
by gpm 8y ago
I've done a fair bit of rust development and never found that to be an issue.
It probably helps that the only ways to introduce new variables are all very distinctive:
let [new variables] = [expr];
if/while let [new variables] = [expr] { [new variables scoped here] }
for [new variables] in expr { [new variables scoped here] }
fn name([new_variables]) { [new variables scoped here] }
- Thiez 8y agoYou forgot `match` and closures. But in general I think new variables can be created in all contexts where a pattern can be used.
- steveklabnik 8y agoYes, in fact, it's always a pattern. Even let x = 5; is a pattern, just a very simple one!