Implement FromIterator<Root<A>> for RootedVec<JS<A>> (fixes #5117)

This commit is contained in:
Anthony Ramine 2015-08-30 23:39:26 +02:00
parent 3062e0c7b1
commit 5cc36f0b91
2 changed files with 14 additions and 3 deletions

View file

@ -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() {