diff options
author | Brandon Fairchild <csbit32@gmail.com> | 2015-11-17 16:58:37 -0500 |
---|---|---|
committer | Brandon Fairchild <csbit32@gmail.com> | 2015-11-17 16:58:37 -0500 |
commit | 6a28d62b15e8c9251e01f674faf342ee6bce1359 (patch) | |
tree | 793a4402be2716956cda2f1a46615308297337c0 /components/script/dom/node.rs | |
parent | 20d26853e145e275695463662b6cee334cd27085 (diff) | |
download | servo-6a28d62b15e8c9251e01f674faf342ee6bce1359.tar.gz servo-6a28d62b15e8c9251e01f674faf342ee6bce1359.zip |
Make Node::is_parent_of more idiomatic
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 3db56ed3c1d..9c296ac4385 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -599,10 +599,7 @@ impl Node { } pub fn is_parent_of(&self, child: &Node) -> bool { - match child.parent_node.get() { - Some(ref parent) => parent.r() == self, - None => false, - } + child.parent_node.get().map_or(false, |ref parent| parent.r() == self) } pub fn to_trusted_node_address(&self) -> TrustedNodeAddress { |