-
Notifications
You must be signed in to change notification settings - Fork 19
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 core::iter::chain
method
#154
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Comments
rossmacarthur
added
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
labels
Dec 28, 2022
Would love to see this added to libstd. Actually was going to file an ACP if this didn't have one already. |
We discussed this in the libs-api meeting today. We're happy to accept this for the same reasons as |
Amanieu
added
the
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
label
May 28, 2024
4 tasks
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this issue
Jun 4, 2024
…nieu Add function `core::iter::chain` 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. ```rust for (x, y) in chain(xs, ys) {} // vs. for (x, y) in xs.into_iter().chain(ys) {} ``` There is prior art for the utility of this in [`itertools::chain`](https://docs.rs/itertools/latest/itertools/fn.chain.html). Approved ACP rust-lang/libs-team#154
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jun 4, 2024
…nieu Add function `core::iter::chain` 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. ```rust for (x, y) in chain(xs, ys) {} // vs. for (x, y) in xs.into_iter().chain(ys) {} ``` There is prior art for the utility of this in [`itertools::chain`](https://docs.rs/itertools/latest/itertools/fn.chain.html). Approved ACP rust-lang/libs-team#154
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jun 4, 2024
Rollup merge of rust-lang#106186 - rossmacarthur:ft/iter-chain, r=Amanieu Add function `core::iter::chain` 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. ```rust for (x, y) in chain(xs, ys) {} // vs. for (x, y) in xs.into_iter().chain(ys) {} ``` There is prior art for the utility of this in [`itertools::chain`](https://docs.rs/itertools/latest/itertools/fn.chain.html). Approved ACP rust-lang/libs-team#154
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Proposal
Problem statement
Add a convenient
IntoIterator
enabled function for chaining two iterators.Motivation, use-cases
core::iter::zip
(added in Add function core::iter::zip rust#82917)Some examples from the rust-lang/rust repo
Solution sketches
The text was updated successfully, but these errors were encountered: