mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace uses of for foo in bar.iter()
,
and `for foo in bar.iter_mut(), and for foo in bar.into_iter() (continuation of #7197)
This commit is contained in:
parent
f4b526cfb4
commit
067a22a868
32 changed files with 76 additions and 78 deletions
|
@ -46,7 +46,7 @@ impl IterablePage for Rc<Page> {
|
|||
}
|
||||
fn find(&self, id: PipelineId) -> Option<Rc<Page>> {
|
||||
if self.id == id { return Some(self.clone()); }
|
||||
for page in self.children.borrow().iter() {
|
||||
for page in &*self.children.borrow() {
|
||||
let found = page.find(id);
|
||||
if found.is_some() { return found; }
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ impl Iterator for PageIterator {
|
|||
fn next(&mut self) -> Option<Rc<Page>> {
|
||||
match self.stack.pop() {
|
||||
Some(next) => {
|
||||
for child in next.children.borrow().iter() {
|
||||
for child in &*next.children.borrow() {
|
||||
self.stack.push(child.clone());
|
||||
}
|
||||
Some(next)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue