aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlinputelement.rs
diff options
context:
space:
mode:
authorOluwatobi Sofela <60105594+oluwatobiss@users.noreply.github.com>2024-03-27 19:43:56 +0100
committerGitHub <noreply@github.com>2024-03-27 18:43:56 +0000
commitda76ebabe9359c6f815f16adc81af7f11bb3265c (patch)
tree80a732b845fda22ce172f48dccedbb6d11efbefa /components/script/dom/htmlinputelement.rs
parenta5bcae212a175d89507bffba7c57313b2cc9b3ab (diff)
downloadservo-da76ebabe9359c6f815f16adc81af7f11bb3265c.tar.gz
servo-da76ebabe9359c6f815f16adc81af7f11bb3265c.zip
clippy: Fix option_map_unit_fn warnings (#31906)
Diffstat (limited to 'components/script/dom/htmlinputelement.rs')
-rwxr-xr-xcomponents/script/dom/htmlinputelement.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index 6c10109a5f0..860d11eb22a 100755
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -2832,18 +2832,20 @@ impl Activatable for HTMLInputElement {
// https://html.spec.whatwg.org/multipage/#submit-button-state-(type=submit):activation-behavior
// FIXME (Manishearth): support document owners (needs ability to get parent browsing context)
// Check if document owner is fully active
- self.form_owner().map(|o| {
+ if let Some(o) = self.form_owner() {
o.submit(
SubmittedFrom::NotFromForm,
FormSubmitter::InputElement(self),
)
- });
+ }
},
InputType::Reset => {
// https://html.spec.whatwg.org/multipage/#reset-button-state-(type=reset):activation-behavior
// FIXME (Manishearth): support document owners (needs ability to get parent browsing context)
// Check if document owner is fully active
- self.form_owner().map(|o| o.reset(ResetFrom::NotFromForm));
+ if let Some(o) = self.form_owner() {
+ o.reset(ResetFrom::NotFromForm)
+ }
},
InputType::Checkbox | InputType::Radio => {
// https://html.spec.whatwg.org/multipage/#checkbox-state-(type=checkbox):activation-behavior