mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
selectors: Simplify SelectorIter::next.
This commit is contained in:
parent
671b69c0b7
commit
bbe7ff86da
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> {
|
||||
debug_assert!(self.next_combinator.is_none(),
|
||||
"You should call next_sequence!");
|
||||
match self.iter.next() {
|
||||
None => None,
|
||||
Some(&Component::Combinator(c)) => {
|
||||
match *self.iter.next()? {
|
||||
Component::Combinator(c) => {
|
||||
self.next_combinator = Some(c);
|
||||
None
|
||||
},
|
||||
Some(x) => Some(x),
|
||||
ref x => Some(x),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue