Unnamed repository; edit this file 'description' to name the repository.
Update crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs
Co-authored-by: Aleksey Kladov <[email protected]>
Yotam Ofek 2021-09-04
parent 0d453cc · commit dd9433c
-rw-r--r--crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs b/crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs
index c5bdbfbbe7..fcf7973bd0 100644
--- a/crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs
+++ b/crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs
@@ -50,7 +50,7 @@ pub(crate) fn replace_for_loop_with_for_each(acc: &mut Assists, ctx: &AssistCont
// We have either "for x in &col" and col implements a method called iter
// or "for x in &mut col" and col implements a method called iter_mut
format_to!(buf, "{}.{}()", expr_behind_ref, method);
- } else if matches!(iterable, ast::Expr::RangeExpr(..)) {
+ } else if let ast::Expr::RangeExpr(..) = iterable {
// range expressions need to be parenthesized for the syntax to be correct
format_to!(buf, "({})", iterable);
} else if impls_core_iter(&ctx.sema, &iterable) {