3 ms·
I don't see iterator syntax being desugared to a counted loop there. I don't doubt that the Rust compiler eventually produces a counted loop when iterating over
by tom_mellior 6y ago
I don't see iterator syntax being desugared to a counted loop there. I don't doubt that the Rust compiler eventually produces a counted loop when iterating over a vector, but this link doesn't demonstrate that.
- steveklabnik 6y agoIt’s not a counted loop, it’s true. for loops are sugar for iterators and an infinite loop + break. My point is that it is not a particularly complex transformation, as you said. I thought the complexity (or lack thereof) was the high order bit. Sorry I should have been more clear!