clippy: Fix collapsible_if warnings (#31852)

This commit is contained in:
Oluwatobi Sofela 2024-03-25 14:55:45 +01:00 committed by GitHub
parent 3d10dbae32
commit a53632c0e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 85 additions and 95 deletions

View file

@ -736,10 +736,12 @@ impl Validatable for HTMLTextAreaElement {
// https://html.spec.whatwg.org/multipage/#suffering-from-being-missing
// https://html.spec.whatwg.org/multipage/#the-textarea-element%3Asuffering-from-being-missing
if validate_flags.contains(ValidationFlags::VALUE_MISSING) {
if self.Required() && self.is_mutable() && value_len == 0 {
failed_flags.insert(ValidationFlags::VALUE_MISSING);
}
if validate_flags.contains(ValidationFlags::VALUE_MISSING) &&
self.Required() &&
self.is_mutable() &&
value_len == 0
{
failed_flags.insert(ValidationFlags::VALUE_MISSING);
}
if value_dirty && last_edit_by_user && value_len > 0 {