clippy: Fix various clippy problems in components/scripts/dom (#31910)

* boxing is unnecessary

* boxing is unnecessary

* boxing is unnecessary

* boxing is unnecessary

* fix

* fix

* fix

* Update globalscope.rs
This commit is contained in:
Rosemary Ajayi 2024-03-31 20:21:52 +00:00 committed by GitHub
parent 9243e8cf71
commit 673eaa569a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -290,7 +290,7 @@ impl Headers {
// https://fetch.spec.whatwg.org/#concept-header-extract-mime-type
pub fn extract_mime_type(&self) -> Vec<u8> {
extract_mime_type(&self.header_list.borrow()).unwrap_or(vec![])
extract_mime_type(&self.header_list.borrow()).unwrap_or_default()
}
// https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine

View file

@ -654,7 +654,7 @@ impl HTMLFormElement {
}
// https://html.spec.whatwg.org/multipage/#text/plain-encoding-algorithm
fn encode_plaintext(&self, form_data: &mut Vec<FormDatum>) -> String {
fn encode_plaintext(&self, form_data: &mut [FormDatum]) -> String {
// Step 1
let mut result = String::new();

View file

@ -767,7 +767,7 @@ impl HTMLInputElement {
first_with_id
.as_ref()
.and_then(|el| el.downcast::<HTMLDataListElement>())
.map(|el| DomRoot::from_ref(el))
.map(DomRoot::from_ref)
}
// https://html.spec.whatwg.org/multipage/#suffering-from-being-missing