Update library/core/src/iter/adapters/peekable.rs

Co-authored-by: Alexander Ronald Altman <alexanderaltman@me.com>
This commit is contained in:
lukaslueg 2021-04-06 18:16:02 +02:00 committed by GitHub
parent abcbe54575
commit 7f32fda78c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,7 +250,7 @@ impl<I: Iterator> Peekable<I> {
/// assert_eq!(iter.collect::<Vec<_>>(), vec![&5, &3]);
/// ```
#[inline]
#[stable(feature = "peekable_peek_mut", since = "1.52.0")]
#[stable(feature = "peekable_peek_mut", since = "1.53.0")]
pub fn peek_mut(&mut self) -> Option<&mut I::Item> {
let iter = &mut self.iter;
self.peeked.get_or_insert_with(|| iter.next()).as_mut()