clippy: fix warnings in components/script (#32023)

This commit is contained in:
Azhar Ismagulova 2024-04-09 10:34:52 +01:00 committed by GitHub
parent 8d513cf4c7
commit 581913f77e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 19 deletions

View file

@ -2826,7 +2826,7 @@ impl GlobalScope {
},
_ => {
p.reject_error(Error::NotSupported);
return p;
p
},
}
}

View file

@ -708,11 +708,10 @@ impl HTMLInputElement {
},
};
} else {
value = value +
match dir {
StepDirection::Down => -f64::from(n) * allowed_value_step,
StepDirection::Up => f64::from(n) * allowed_value_step,
};
value += match dir {
StepDirection::Down => -f64::from(n) * allowed_value_step,
StepDirection::Up => f64::from(n) * allowed_value_step,
};
}
// Step 8
@ -2085,8 +2084,7 @@ impl HTMLInputElement {
if self.upcast::<Element>().click_in_progress() {
return;
}
let submit_button;
submit_button = node
let submit_button = node
.query_selector_iter(DOMString::from("input[type=submit]"))
.unwrap()
.filter_map(DomRoot::downcast::<HTMLInputElement>)
@ -2102,7 +2100,7 @@ impl HTMLInputElement {
}
},
None => {
let inputs = node
let mut inputs = node
.query_selector_iter(DOMString::from("input"))
.unwrap()
.filter_map(DomRoot::downcast::<HTMLInputElement>)
@ -2125,7 +2123,7 @@ impl HTMLInputElement {
)
});
if inputs.skip(1).next().is_some() {
if inputs.nth(1).is_some() {
// lazily test for > 1 submission-blocking inputs
return;
}