mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Convince borrowck that Document::createNodeList is sound.
This commit is contained in:
parent
e5ae267e80
commit
eb715a7bf8
1 changed files with 4 additions and 3 deletions
|
@ -480,10 +480,11 @@ trait PrivateDocumentHelpers {
|
|||
impl<'a> PrivateDocumentHelpers for JSRef<'a, Document> {
|
||||
fn createNodeList(self, callback: |node: JSRef<Node>| -> bool) -> Temporary<NodeList> {
|
||||
let window = self.window.root();
|
||||
let nodes = match self.GetDocumentElement().root() {
|
||||
let document_element = self.GetDocumentElement().root();
|
||||
let nodes = match document_element {
|
||||
None => vec!(),
|
||||
Some(root) => {
|
||||
let root: JSRef<Node> = NodeCast::from_ref(*root);
|
||||
Some(ref root) => {
|
||||
let root: JSRef<Node> = NodeCast::from_ref(root.r());
|
||||
root.traverse_preorder().filter(|&node| callback(node)).collect()
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue