mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Make Node::is_parent_of more idiomatic
This commit is contained in:
parent
20d26853e1
commit
6a28d62b15
1 changed files with 1 additions and 4 deletions
|
@ -599,10 +599,7 @@ impl Node {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_parent_of(&self, child: &Node) -> bool {
|
pub fn is_parent_of(&self, child: &Node) -> bool {
|
||||||
match child.parent_node.get() {
|
child.parent_node.get().map_or(false, |ref parent| parent.r() == self)
|
||||||
Some(ref parent) => parent.r() == self,
|
|
||||||
None => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_trusted_node_address(&self) -> TrustedNodeAddress {
|
pub fn to_trusted_node_address(&self) -> TrustedNodeAddress {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue