diff options
author | Ekta Siwach <137225906+ektuu@users.noreply.github.com> | 2024-03-29 20:13:10 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-29 14:43:10 +0000 |
commit | b0196ad3734149c98cfad89df0864fca3bdf92ce (patch) | |
tree | 36d0aa69709b7e6fdaf055b50c8eac386891b17b /components/script/dom/htmlselectelement.rs | |
parent | 4a68243f65c4fc32a4d12faa21d9c36e02a05f52 (diff) | |
download | servo-b0196ad3734149c98cfad89df0864fca3bdf92ce.tar.gz servo-b0196ad3734149c98cfad89df0864fca3bdf92ce.zip |
clippy: Fix a variety of warnings in components/script/dom (#31894)
Diffstat (limited to 'components/script/dom/htmlselectelement.rs')
-rwxr-xr-x | components/script/dom/htmlselectelement.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs index ed50de11a53..74964bfe25c 100755 --- a/components/script/dom/htmlselectelement.rs +++ b/components/script/dom/htmlselectelement.rs @@ -518,11 +518,10 @@ impl Validatable for HTMLSelectElement { // https://html.spec.whatwg.org/multipage/#the-select-element%3Asuffering-from-being-missing if validate_flags.contains(ValidationFlags::VALUE_MISSING) && self.Required() { let placeholder = self.get_placeholder_label_option(); - let selected_option = self + let is_value_missing = !self .list_of_options() - .filter(|e| e.Selected() && placeholder.as_ref() != Some(e)) - .next(); - failed_flags.set(ValidationFlags::VALUE_MISSING, selected_option.is_none()); + .any(|e| e.Selected() && placeholder != Some(e)); + failed_flags.set(ValidationFlags::VALUE_MISSING, is_value_missing); } failed_flags |