mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +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 {
|
||||
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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue