diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-08-30 23:39:26 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-08-31 10:11:29 +0200 |
commit | 5cc36f0b9112a96053b90a1bb50a21228312f85e (patch) | |
tree | 7e963673707ccfd3eaa0485539b34cbc5bad2b0e /components/script/dom/node.rs | |
parent | 3062e0c7b11196e478a7e530e5b969adcce8bf4b (diff) | |
download | servo-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.rs | 3 |
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() { |