The only reason to prefer internal iterators is the difficulty of implementing an external one for recursive data types and often for mutable iterators. We can still provide adaptors for composing internal iterators (iter.rs) but there's no need to provide internal iterators ourselves side-by-side with external iterators.
I think we should throw out the dozens of internal iterators we have on str and vec since they already have a mutable and immutable external iterator. We just need iterators for reverse traversal and the internal ones will be entirely redundant.
For example, there's no need for hardcoded internal iterators like each2 when we have xs.zip(ys) for any two arbitrary iterators - not just two vectors.
See: https://mail.mozilla.org/pipermail/rust-dev/2013-June/004364.html
The only reason to prefer internal iterators is the difficulty of implementing an external one for recursive data types and often for mutable iterators. We can still provide adaptors for composing internal iterators (
iter.rs) but there's no need to provide internal iterators ourselves side-by-side with external iterators.I think we should throw out the dozens of internal iterators we have on
strandvecsince they already have a mutable and immutable external iterator. We just need iterators for reverse traversal and the internal ones will be entirely redundant.For example, there's no need for hardcoded internal iterators like
each2when we havexs.zip(ys)for any two arbitrary iterators - not just two vectors.See: https://mail.mozilla.org/pipermail/rust-dev/2013-June/004364.html