Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specialize methods on iter::Cloned<I> where I::Item: Copy. #39022

Closed
wants to merge 1 commit into from

Commits on Jan 12, 2017

  1. 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.
    Stebalien committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    f127423 View commit details
    Browse the repository at this point in the history