Skip to content

Commit

Permalink
Make Node::is_parent_of more idiomatic
Browse files Browse the repository at this point in the history
  • Loading branch information
nerith committed Nov 17, 2015
1 parent 20d2685 commit 6a28d62
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions components/script/dom/node.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 6a28d62

Please sign in to comment.