clippy: Fix explicit_auto_deref warnings in components/script (#31837)

* clippy: Fix explicit auto-deref warnings

* clippy: Fix explicit auto-deref warnings

* refactor: Tidy up code

* refactor: Fix method not found errors
This commit is contained in:
Oluwatobi Sofela 2024-03-23 12:29:20 +01:00 committed by GitHub
parent 3fc157338e
commit 3c05b58221
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 157 additions and 168 deletions

View file

@ -425,7 +425,7 @@ impl Tokenizer {
let element = create_element_for_token(
name,
attrs,
&*self.document,
&self.document,
ElementCreator::ParserCreated(current_line),
ParsingAlgorithm::Normal,
);
@ -480,7 +480,7 @@ impl Tokenizer {
},
ParseOperation::RemoveFromParent { target } => {
if let Some(ref parent) = self.get_node(&target).GetParentNode() {
parent.RemoveChild(&**self.get_node(&target)).unwrap();
parent.RemoveChild(self.get_node(&target)).unwrap();
}
},
ParseOperation::MarkScriptAlreadyStarted { node } => {

View file

@ -173,7 +173,7 @@ impl SerializationIterator {
let mut ret = SerializationIterator { stack: vec![] };
if skip_first || node.is::<DocumentFragment>() || node.is::<Document>() {
for c in rev_children_iter(node) {
ret.push_node(&*c);
ret.push_node(&c);
}
} else {
ret.push_node(node);

View file

@ -483,7 +483,7 @@ impl ServoParser {
prefetch_input.push_back(chunk.clone());
self.prefetch_tokenizer
.borrow_mut()
.feed(&mut *prefetch_input);
.feed(&mut prefetch_input);
}
// Push the chunk into the network input stream,
// which is tokenized lazily.
@ -1130,7 +1130,7 @@ impl TreeSink for Sink {
let element = create_element_for_token(
name,
attrs,
&*self.document,
&self.document,
ElementCreator::ParserCreated(self.current_line),
self.parsing_algorithm,
);

View file

@ -206,7 +206,7 @@ impl PrefetchSink {
fn get_referrer_policy(&self, tag: &Tag, name: LocalName) -> Option<ReferrerPolicy> {
self.get_attr(tag, name)
.and_then(|attr| determine_policy_for_token(&*attr.value))
.and_then(|attr| determine_policy_for_token(&attr.value))
.or(self.referrer_policy)
}