diff options
author | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-05-02 13:13:06 +0900 |
---|---|---|
committer | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-05-02 13:22:50 +0900 |
commit | 31cf10c006a537cbcb6df2e6bb419c4f6bcb0fb9 (patch) | |
tree | b54476cc88d2e4aeaaa5ca0a9139be08ccb3eda8 /src | |
parent | b36b779d24c6f7425f630c18495dae4c6edec137 (diff) | |
download | servo-31cf10c006a537cbcb6df2e6bb419c4f6bcb0fb9.tar.gz servo-31cf10c006a537cbcb6df2e6bb419c4f6bcb0fb9.zip |
Node::GetParentElement should use and_then instead of filtered/map.
Diffstat (limited to 'src')
-rw-r--r-- | src/components/script/dom/node.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 95c41e8b7d7..d5b43a6257f 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -902,9 +902,7 @@ impl Node { // http://dom.spec.whatwg.org/#dom-node-parentelement pub fn GetParentElement(&self) -> Option<JS<Element>> { - self.parent_node.clone() - .filtered(|parent| parent.is_element()) - .map(|node| ElementCast::to(&node).unwrap()) + self.parent_node.clone().and_then(|parent| ElementCast::to(&parent)) } // http://dom.spec.whatwg.org/#dom-node-haschildnodes |