3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/rust/rust-analyzer/rust_1_49.patch
2021-03-15 19:18:11 +01:00

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)]