Skip to content

Commit

Permalink
Peekable::peek(): Use Option::as_ref()
Browse files Browse the repository at this point in the history
  • Loading branch information
mglagla committed Nov 3, 2016
1 parent ac919fc commit ed0230e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/libcore/iter/mod.rs
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit ed0230e

Please sign in to comment.