mirror of
https://github.com/servo/servo
synced 2026-05-01 03:47:53 +02:00
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:
@@ -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() &&
|
||||
|
||||
Reference in New Issue
Block a user