changed match to 'matches!' (#31850)

This commit is contained in:
Aarya Khandelwal 2024-03-25 16:58:12 +05:30 committed by GitHub
parent 9a76dd9325
commit bd39e03eeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 185 additions and 229 deletions

View file

@ -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>