mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
changed match
to 'matches!' (#31850)
This commit is contained in:
parent
9a76dd9325
commit
bd39e03eeb
29 changed files with 185 additions and 229 deletions
|
@ -127,13 +127,13 @@ impl Range {
|
|||
|
||||
/// <https://dom.spec.whatwg.org/#contained>
|
||||
fn contains(&self, node: &Node) -> bool {
|
||||
match (
|
||||
bp_position(node, 0, &self.start_container(), self.start_offset()),
|
||||
bp_position(node, node.len(), &self.end_container(), self.end_offset()),
|
||||
) {
|
||||
(Some(Ordering::Greater), Some(Ordering::Less)) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(
|
||||
(
|
||||
bp_position(node, 0, &self.start_container(), self.start_offset()),
|
||||
bp_position(node, node.len(), &self.end_container(), self.end_offset()),
|
||||
),
|
||||
(Some(Ordering::Greater), Some(Ordering::Less))
|
||||
)
|
||||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#partially-contained>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue