The documentation on iterators describes the advantages of using iteration rather than direct indexing in a loop: http://doc.rust-lang.org/nightly/book/iterators.html
The gist is that an iterator has enough information about the thing that it's iterating over that we, as library authors, can avoid unnecessary bounds checking and just perform unchecked indexing while retaining all the safety. LLVM is also surprisingly good at automatically vectorizing our iterators.
Re:Rust Priorities after 1.0
by captaincrowbar on Friday April 17, 2015 @07:21PM
(#9397738)
Thanks!
Can you explain this or point me to the relevant documentation or code please?