Tracking issue for std::iter::Peekable::peek_mut #78302
Labels
A-iterators
Area: Iterators
C-tracking-issue
Category: A tracking issue for an RFC or an unstable feature.
Libs-Tracked
Libs issues that are tracked on the team's project board.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Feature name:
peekable_peek_mut
History:
peekable_peek_mut
#81938A "peekable" iterator has a peek()-method which provides an immutable reference to the next item. We currently do not have a method to modify that item, which we could easily add via a peek_mut(). A draft-implementation to add a new
peek_mut
-method is in #77491A
peek_mut
would allow one to peek into the very next item the iterator will return and change it if so desired (essentially a single-shot.map()
):The text was updated successfully, but these errors were encountered: