Peekable::peek(): Use Option::as_ref()

This commit is contained in:
Martin Glagla 2016-11-03 22:22:27 +01:00
parent ac919fcd9d
commit ed0230ee56

View File

@ -1341,10 +1341,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()
}
}