mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Cleanup PageIterator::next.
This commit is contained in:
parent
adc493ccce
commit
8fe798d439
1 changed files with 8 additions and 8 deletions
|
@ -270,14 +270,14 @@ impl Page {
|
||||||
|
|
||||||
impl Iterator<Rc<Page>> for PageIterator {
|
impl Iterator<Rc<Page>> for PageIterator {
|
||||||
fn next(&mut self) -> Option<Rc<Page>> {
|
fn next(&mut self) -> Option<Rc<Page>> {
|
||||||
if !self.stack.is_empty() {
|
match self.stack.pop() {
|
||||||
let next = self.stack.pop().unwrap();
|
Some(next) => {
|
||||||
for child in next.children.borrow().iter() {
|
for child in next.children.borrow().iter() {
|
||||||
self.stack.push(child.clone());
|
self.stack.push(child.clone());
|
||||||
}
|
}
|
||||||
Some(next.clone())
|
Some(next)
|
||||||
} else {
|
},
|
||||||
None
|
None => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue