3 ms·
Okay, this is a revelation. I hadn't seen refutable lets, and this seems great!
by aethertap 12y ago
Okay, this is a revelation. I hadn't seen refutable lets, and this seems great!
- masklinn 12y agoRefutable lets also work in `while` (`while let pattern = expression { … }`), which is pretty great.
- aethertap 12y agoI just rewrote one of my parser functions using that, and it literally eliminated 90% of the code and improved error reporting at the same time. Very cool, thanks for the tip.
- geofft 12y agoTake a look at this PR: https://github.com/rust-lang/rust/pull/19405/files https://github.com/rust-lang/rust/pull/19405/files