hashglobe: Use ? on Option more often.

This commit is contained in:
Emilio Cobos Álvarez 2017-12-09 20:27:02 +01:00
parent 339d633906
commit 6c37edf602
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -1051,13 +1051,9 @@ impl<'a, T, S> Iterator for Intersection<'a, T, S>
fn next(&mut self) -> Option<&'a T> { fn next(&mut self) -> Option<&'a T> {
loop { loop {
match self.iter.next() { let elt = self.iter.next()?;
None => return None, if self.other.contains(elt) {
Some(elt) => { return Some(elt);
if self.other.contains(elt) {
return Some(elt);
}
}
} }
} }
} }
@ -1091,13 +1087,9 @@ impl<'a, T, S> Iterator for Difference<'a, T, S>
fn next(&mut self) -> Option<&'a T> { fn next(&mut self) -> Option<&'a T> {
loop { loop {
match self.iter.next() { let elt = self.iter.next()?;
None => return None, if !self.other.contains(elt) {
Some(elt) => { return Some(elt);
if !self.other.contains(elt) {
return Some(elt);
}
}
} }
} }
} }