mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
386a067c4b
commit
a34920b605
6 changed files with 16 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue