Skip to content

Tracking Issue for peekable_next_if_map #143702

Open
@kennytm

Description

@kennytm

Feature gate: #![feature(peekable_next_if_map)]

This is a tracking issue for the std::iter::Peekable::next_if_map() function, as a combination of next_if() and transformation in a single step (ACP: rust-lang/libs-team#613).

Public API

impl<I: Iterator> Peekable<I> {
    pub fn next_if_map<R>(
        &mut self,
        f: impl FnOnce(I::Item) -> Result<R, I::Item>,
    ) -> Option<R>;
}

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions

  • In the ACP a by-ref version ((&mut self, impl FnOnce(&I::Item) -> Option<R>) -> Option<R>) was also proposed. Whether the by-ref version is needed?

Footnotes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-impl-incompleteStatus: The implementation is incomplete.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions