3 ms·
> If I can avoid an index variable, I’m going to have less bugs since I won’t have to index. Not only that. In safe Rust vector indexes are always bound-checke
by lr1970 4y ago
> If I can avoid an index variable, I’m going to have less bugs since I won’t have to index.
Not only that. In safe Rust vector indexes are always bound-checked that slows execution a little bit. Iterators over a vector, on the other hand, do not suffer from bound-check overhead.