-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #25035 - Stebalien:iter, r=aturon
Specifically, make count, nth, and last call the corresponding methods on the underlying iterator where possible. This way, if the underlying iterator has an optimized count, nth, or last implementations (e.g. slice::Iter), these methods will propagate these optimizations. Additionally, change Skip::next to take advantage of a potentially optimized nth method on the underlying iterator. This covers: * core::iter::Chain: count, last, nth * core::iter::Enumerate: count, nth * core::iter::Peekable: count, last, nth * core::iter::Skip: count, last, next (should call nth), nth * core::iter::Take: nth * core::iter::Fuse: count, last, nth of #24214.
- Loading branch information
Showing
2 changed files
with
360 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.