mirror of
https://github.com/servo/servo.git
synced 2025-07-17 12:23:40 +01:00
hashglobe: Use ? on Option more often.
This commit is contained in:
parent
339d633906
commit
6c37edf602
1 changed files with 6 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue