fix(clippy): Clippy suggestions in components/script/dom/* (#33072)

Signed-off-by: Jose T. Monagas <josetmonagas@proton.me>
Co-authored-by: Jose T. Monagas <josetmonagas@proton.me>
This commit is contained in:
Jose Monagas 2024-08-15 22:31:30 +03:00 committed by GitHub
parent 386a067c4b
commit a34920b605
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 16 additions and 15 deletions

View file

@ -604,6 +604,11 @@ impl Node {
}
}
pub fn is_empty(&self) -> bool {
// A node is considered empty if its length is 0.
return self.len() == 0;
}
/// <https://dom.spec.whatwg.org/#concept-tree-index>
pub fn index(&self) -> u32 {
self.preceding_siblings().count() as u32