Cleanup Document::GetDocumentElement.

This commit is contained in:
Ms2ger 2014-12-04 09:44:01 +01:00
parent 41395412eb
commit 2ce4c6c529

View file

@ -529,7 +529,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
// http://dom.spec.whatwg.org/#dom-document-documentelement
fn GetDocumentElement(self) -> Option<Temporary<Element>> {
let node: JSRef<Node> = NodeCast::from_ref(self);
node.child_elements().next().map(|elem| Temporary::from_rooted(elem))
node.child_elements().next().map(Temporary::from_rooted)
}
// http://dom.spec.whatwg.org/#dom-document-getelementsbytagname