aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-08-30 23:39:26 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-08-31 10:11:29 +0200
commit5cc36f0b9112a96053b90a1bb50a21228312f85e (patch)
tree7e963673707ccfd3eaa0485539b34cbc5bad2b0e /components/script/dom/node.rs
parent3062e0c7b11196e478a7e530e5b969adcce8bf4b (diff)
downloadservo-5cc36f0b9112a96053b90a1bb50a21228312f85e.tar.gz
servo-5cc36f0b9112a96053b90a1bb50a21228312f85e.zip
Implement FromIterator<Root<A>> for RootedVec<JS<A>> (fixes #5117)
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index ac21c9eefc2..f46cbc0be11 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -1629,8 +1629,7 @@ impl Node {
Node::adopt(node, &*parent.owner_doc());
}
// Step 2.
- let mut removed_nodes = RootedVec::new();
- removed_nodes.extend(parent.children().map(|child| JS::from_rooted(&child)));
+ let removed_nodes = parent.children().collect::<RootedVec<_>>();
// Step 3.
let mut added_nodes = RootedVec::new();
let added_nodes = if let Some(node) = node.as_ref() {