mirror of
https://github.com/servo/servo.git
synced 2025-07-19 13:23:46 +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> {
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue