Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specialize methods on iter::Cloned<I> where I::Item: Copy.
Instead of cloning a bunch of copyable types only to drop them (in `nth`, `last`, and `count`), take advantage of rust-lang#1521 (Copy clone semantics) and don't bother cloning them in the first place (directly call `nth`, `last`, and `count` on the wrapped iterator). If the wrapped iterator optimizes these methods, `Cloned` now inherits this optimization.
- Loading branch information