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

Tracking Issue for core::iter::chain #125964

Open
2 of 4 tasks
rossmacarthur opened this issue Jun 4, 2024 · 1 comment
Open
2 of 4 tasks

Tracking Issue for core::iter::chain #125964

rossmacarthur opened this issue Jun 4, 2024 · 1 comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@rossmacarthur
Copy link
Contributor

Feature gate: #![feature(iter_chain)]

This is a tracking issue for the core::iter::chain function that combines two IntoIterator arguments together into a Chain iterator.

Public API

// core::iter
pub fn chain<A, B>(a: A, b: B) -> Chain<A::IntoIter, B::IntoIter>
where
    A: IntoIterator,
    B: IntoIterator<Item = A::Item>;

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@rossmacarthur rossmacarthur added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jun 4, 2024
@scottmcm
Copy link
Member

I was reminded of this by it showing up on URLO: https://users.rust-lang.org/t/iterator-extension-allthesame/117972/3?u=scottmcm

Can we just stabilize it? Having both sides be IntoIterator is nice.

Only other choice I could come up with for the signature would be

pub fn chain<A, B>(a: impl IntoIterator<IntoIter = A>, b: impl IntoIterator<IntoIter = B>) -> Chain<A, B>
where
    A: Iterator,
    B: Iterator<Item = A::Item>;

but that really doesn't seem materially better, so as it is seems good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants