Use ? operator instead of explictly propagating None

This commit is contained in:
Sebastian Dröge 2018-10-11 11:30:12 +03:00
parent fa29872863
commit d19c70694a

View file

@ -372,13 +372,9 @@ macro_rules! define_iter(
} }
unsafe { unsafe {
let item = $get_item(self.caps, self.idx); let item = $get_item(self.caps, self.idx)?;
if item.is_none() {
return None;
}
self.idx += 1; self.idx += 1;
item Some(item)
} }
} }