Re:Thoughts on Rust, a few thousand lines in
by Thiez on Wednesday January 09, 2019 @04:50PM
(#18869294)
You forgot `match` and closures. But in general I think new variables can be created in all contexts where a pattern can be used.
Re:Thoughts on Rust, a few thousand lines in
by steveklabnik on Wednesday January 09, 2019 @04:55PM
(#18869341)
Yes, in fact, it's always a pattern. Even let x = 5; is a pattern, just a very simple one!
It probably helps that the only ways to introduce new variables are all very distinctive: