Rollup merge of #37565 - mglagla:peek_use_as_ref, r=alexcrichton
Peekable::peek(): Use Option::as_ref() Replace the match expression in .peek() with Option::as_ref() since it's the same functionality.
This commit is contained in:
commit
b9f18bf79b
@ -1374,10 +1374,7 @@ impl<I: Iterator> Peekable<I> {
|
||||
if self.peeked.is_none() {
|
||||
self.peeked = self.iter.next();
|
||||
}
|
||||
match self.peeked {
|
||||
Some(ref value) => Some(value),
|
||||
None => None,
|
||||
}
|
||||
self.peeked.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user