Closed
Description
Internal iterators (e.g., Iterator::fold(...)
) often optimize better (e.g., in Zip
, FlatMap
, etc...) as they don't need to repeatedly check the entire state of the iterator every iteration. Given that FromIterator
and Extend
implementations consume the entire iterator, they could use internal iterators and take advantage of this fact.
(I have no benchmarks or code and don't really have time to do anything but suggest that someone else look into this ATM, sorry.)