mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
clippy: Fix a variety of warnings in components/script/dom (#31894)
This commit is contained in:
parent
4a68243f65
commit
b0196ad373
10 changed files with 45 additions and 43 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue