Use try syntax for Option where appropriate

This commit is contained in:
Matt Brubeck 2017-10-20 08:25:35 -07:00
parent fe16c1d5c3
commit 2d45e9d2da
19 changed files with 65 additions and 180 deletions

View file

@ -78,10 +78,7 @@ impl<'a, T> Iterator for PersistentListIterator<'a, T> where T: Send + Sync + 's
#[inline]
fn next(&mut self) -> Option<&'a T> {
let entry = match self.entry {
None => return None,
Some(entry) => entry,
};
let entry = self.entry?;
let value = &entry.value;
self.entry = match entry.next {
None => None,