clippy: Fix a few problems in components/script (#31961)

* fixed various clippy warnings

* fixed various clippy warnings
This commit is contained in:
Rosemary Ajayi 2024-04-01 07:18:32 +00:00 committed by GitHub
parent 52a74287fc
commit fd8235e409
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -597,7 +597,7 @@ impl HTMLFormElementMethods for HTMLFormElement {
// Step 7-8
let mut names_vec: Vec<DOMString> = Vec::new();
for elem in sourced_names_vec.iter() {
if names_vec.iter().find(|name| **name == *elem.name).is_none() {
if !names_vec.iter().any(|name| *name == *elem.name) {
names_vec.push(DOMString::from(&*elem.name));
}
}

View file

@ -1183,7 +1183,7 @@ impl HTMLInputElementMethods for HTMLInputElement {
// https://html.spec.whatwg.org/multipage/#dom-input-files
fn GetFiles(&self) -> Option<DomRoot<FileList>> {
self.filelist.get().as_ref().map(|fl| fl.clone())
self.filelist.get().as_ref().cloned()
}
// https://html.spec.whatwg.org/multipage/#dom-input-defaultchecked