clippy: Fix clippy Problems in components/scripts (#31759)

* revert cargo

* revert cargo

* fic clippy problems
This commit is contained in:
Rosemary Ajayi 2024-03-19 22:22:37 +00:00 committed by GitHub
parent 96e5e776d2
commit 865f6e621f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 69 additions and 81 deletions

View file

@ -2089,13 +2089,13 @@ impl Node {
);
} else {
// Step 7.7.2.2.
try_upgrade_element(&*descendant);
try_upgrade_element(&descendant);
}
}
}
}
if let SuppressObserver::Unsuppressed = suppress_observers {
vtable_for(&parent).children_changed(&ChildrenMutation::insert(
vtable_for(parent).children_changed(&ChildrenMutation::insert(
previous_sibling.as_deref(),
new_nodes,
child,
@ -2107,7 +2107,7 @@ impl Node {
prev: previous_sibling.as_deref(),
next: child,
};
MutationObserver::queue_a_mutation_record(&parent, mutation);
MutationObserver::queue_a_mutation_record(parent, mutation);
}
node.owner_doc().remove_script_and_layout_blocker();
}
@ -2117,7 +2117,7 @@ impl Node {
parent.owner_doc().add_script_and_layout_blocker();
// Step 1.
if let Some(node) = node {
Node::adopt(node, &*parent.owner_doc());
Node::adopt(node, &parent.owner_doc());
}
// Step 2.
rooted_vec!(let removed_nodes <- parent.children());
@ -2142,7 +2142,7 @@ impl Node {
Node::insert(node, parent, None, SuppressObserver::Suppressed);
}
// Step 6.
vtable_for(&parent).children_changed(&ChildrenMutation::replace_all(
vtable_for(parent).children_changed(&ChildrenMutation::replace_all(
removed_nodes.r(),
added_nodes,
));
@ -2154,7 +2154,7 @@ impl Node {
prev: None,
next: None,
};
MutationObserver::queue_a_mutation_record(&parent, mutation);
MutationObserver::queue_a_mutation_record(parent, mutation);
}
parent.owner_doc().remove_script_and_layout_blocker();
}
@ -2216,9 +2216,9 @@ impl Node {
// Step 11. transient registered observers
// Step 12.
if let SuppressObserver::Unsuppressed = suppress_observers {
vtable_for(&parent).children_changed(&ChildrenMutation::replace(
vtable_for(parent).children_changed(&ChildrenMutation::replace(
old_previous_sibling.as_deref(),
&Some(&node),
&Some(node),
&[],
old_next_sibling.as_deref(),
));
@ -2230,7 +2230,7 @@ impl Node {
prev: old_previous_sibling.as_deref(),
next: old_next_sibling.as_deref(),
};
MutationObserver::queue_a_mutation_record(&parent, mutation);
MutationObserver::queue_a_mutation_record(parent, mutation);
}
parent.owner_doc().remove_script_and_layout_blocker();
}
@ -2360,7 +2360,7 @@ impl Node {
}
// Step 5: cloning steps.
vtable_for(&node).cloning_steps(&copy, maybe_doc, clone_children);
vtable_for(node).cloning_steps(&copy, maybe_doc, clone_children);
// Step 6.
if clone_children == CloneChildrenFlag::CloneChildren {
@ -2387,7 +2387,7 @@ impl Node {
pub fn collect_text_contents<T: Iterator<Item = DomRoot<Node>>>(iterator: T) -> DOMString {
let mut content = String::new();
for node in iterator {
if let Some(ref text) = node.downcast::<Text>() {
if let Some(text) = node.downcast::<Text>() {
content.push_str(&text.upcast::<CharacterData>().data());
}
}
@ -2477,7 +2477,7 @@ impl NodeMethods for Node {
// https://dom.spec.whatwg.org/#dom-node-isconnected
fn IsConnected(&self) -> bool {
return self.is_connected();
self.is_connected()
}
// https://dom.spec.whatwg.org/#dom-node-ownerdocument
@ -2758,7 +2758,7 @@ impl NodeMethods for Node {
Node::insert(node, self, reference_child, SuppressObserver::Suppressed);
// Step 14.
vtable_for(&self).children_changed(&ChildrenMutation::replace(
vtable_for(self).children_changed(&ChildrenMutation::replace(
previous_sibling.as_deref(),
&removed_child,
nodes,