Skip to content

Commit

Permalink
Rollup merge of rust-lang#37565 - mglagla:peek_use_as_ref, r=alexcric…
Browse files Browse the repository at this point in the history
…hton

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

Replace the match expression in .peek() with Option::as_ref() since it's the same functionality.
  • Loading branch information
alexcrichton committed Nov 4, 2016
2 parents 1c47c3e + ed0230e commit d244118
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit d244118

Please sign in to comment.