forked from mirrors/nixpkgs
14 lines
666 B
Diff
14 lines
666 B
Diff
diff --git a/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs b/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs
|
|
index 4e75a7b14..91f51a1a7 100644
|
|
--- a/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs
|
|
+++ b/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs
|
|
@@ -93,7 +93,7 @@ fn validate_method_call_expr(
|
|
let krate = module.krate();
|
|
|
|
let iter_trait = FamousDefs(sema, Some(krate)).core_iter_Iterator()?;
|
|
- it_type.impls_trait(sema.db, iter_trait, &[]).then(|| (expr, receiver))
|
|
+ if it_type.impls_trait(sema.db, iter_trait, &[]) { Some((expr, receiver)) } else { None }
|
|
}
|
|
|
|
#[cfg(test)]
|