3 ms·
As kibwen explains above, Rust is just switching the dominant iteration protocol to external iterators, i.e. the protocol privileged/understood by the `for` syn
by dbaupp 13y ago
As kibwen explains above, Rust is just switching the dominant iteration protocol to external iterators, i.e. the protocol privileged/understood by the `for` syntactic sugar. It will still perfectly possible to write
do tree.visit_each_leaf |leaf| {
// ... do things with leaf ...
if some_continuation_condition { true } else { false }
}
(The last line is the replacement for what would be currently written `if !some_continuation_condition { break }` with the `for` sugar.)