mozilla/rust — pull request #7882 by blake2-ppc (2013-07-18 19:02:22+00:00)
Title: Implement .cycle() for clonable iterators and impl Clone for some iterators

Implement method .cycle() that repeats an iterator endlessly

Implement Clone for simple iterators (without closures), including VecIterator.

> The theory is simple, the immutable iterators simply hold state
> variables (indicies or pointers) into frozen containers. We can freely
> clone these iterators, just like we can clone borrowed pointers.