3 ms·
Rust has `loop {}` which I thought was weird at first, but also ended up use more than I would have expected.
by ohazi 5y ago
Rust has `loop {}` which I thought was weird at first, but also ended up use more than I would have expected.
- kevinmgranger 5y agoOne especially nice part of rust's `loop` is since it's guaranteed to run at least once and to terminate, you can break with a value! let foo = loop { // ... if condition { break value; } // ... }