style: Use the ? operator for Option

This commit is contained in:
Matt Brubeck 2017-12-08 16:53:17 -08:00
parent c52d347022
commit 3005a26daf
13 changed files with 47 additions and 129 deletions

View file

@ -80,10 +80,7 @@ where
fn next(&mut self) -> Option<Self::Item> {
loop {
if self.current.is_none() {
let next_origin = match self.origins.next() {
Some(o) => o,
None => return None,
};
let next_origin = self.origins.next()?;
self.current =
Some((next_origin, self.collections.borrow_for_origin(&next_origin).iter()));
@ -238,10 +235,7 @@ where
use std::mem;
loop {
let potential_sheet = match self.iter.next() {
Some(s) => s,
None => return None,
};
let potential_sheet = self.iter.next()?;
let dirty = mem::replace(&mut potential_sheet.dirty, false);
if dirty {