-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add function core::iter::chain
#106186
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
Add function core::iter::chain
#106186
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@rustbot label +T-libs-api -T-libs |
You need to create an ACP first. |
f1b8a1a
to
21726c3
Compare
@rustbot label -S-waiting-on-author +S-waiting-on-ACP |
r? libs |
Correction: r? libs-api |
@Amanieu I see the ACP was approved, let me know if this PR needs any changes. |
The addition of `core::iter::zip` (rust-lang#82917) set a precedent for adding plain functions for iterator adaptors. Adding `chain` makes it a little easier to `chain` two iterators. ``` for (x, y) in chain(xs, ys) {} // vs. for (x, y) in xs.into_iter().chain(ys) {} ```
21726c3
to
6a84995
Compare
@bors r+ |
The addition of
core::iter::zip
(#82917) set a precedent for adding plain functions for iterator adaptors. Addingchain
makes it a little easier tochain
two iterators.There is prior art for the utility of this in
itertools::chain
.Approved ACP rust-lang/libs-team#154