Replace calls to ".filter_map()" followed by ".next()" with ".find_map()" (#40612)

The two are semantically equivalent, but `find_map` is more concise.

Testing: Covered by existing tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker
2025-11-13 15:53:57 +01:00
committed by GitHub
parent a6cc0ec0fe
commit a1269e809d
15 changed files with 57 additions and 105 deletions

View File

@@ -1623,8 +1623,7 @@ pub(crate) trait FormControl: DomObject {
let has_form_id = elem.has_attribute(&local_name!("form"));
let nearest_form_ancestor = node
.ancestors()
.filter_map(DomRoot::downcast::<HTMLFormElement>)
.next();
.find_map(DomRoot::downcast::<HTMLFormElement>);
// Step 1
if old_owner.is_some() &&