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> {
loop {
match self.iter.next() {
None => return None,
Some(elt) => {
if self.other.contains(elt) {
return Some(elt);
}
}
let elt = self.iter.next()?;
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> {
loop {
match self.iter.next() {
None => return None,
Some(elt) => {
if !self.other.contains(elt) {
return Some(elt);
}
}
let elt = self.iter.next()?;
if !self.other.contains(elt) {
return Some(elt);
}
}
}