Open
Description
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.)
- Implementation: core: add Peekable::next_if_map #143725
- Final comment period (FCP)1
- Stabilization PR
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?