mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Auto merge of #19813 - emilio:tidy, r=nox
selectors: Simplify SelectorIter::next. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19813) <!-- Reviewable:end -->
This commit is contained in:
commit
726a1854b0
1 changed files with 3 additions and 4 deletions
|
@ -609,13 +609,12 @@ impl<'a, Impl: SelectorImpl> Iterator for SelectorIter<'a, Impl> {
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
debug_assert!(self.next_combinator.is_none(),
|
debug_assert!(self.next_combinator.is_none(),
|
||||||
"You should call next_sequence!");
|
"You should call next_sequence!");
|
||||||
match self.iter.next() {
|
match *self.iter.next()? {
|
||||||
None => None,
|
Component::Combinator(c) => {
|
||||||
Some(&Component::Combinator(c)) => {
|
|
||||||
self.next_combinator = Some(c);
|
self.next_combinator = Some(c);
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
Some(x) => Some(x),
|
ref x => Some(x),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue