4 ms·
One 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 {
by kevinmgranger 5y ago
One 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;
}
// ...
}