From dd9433cc6326b868a07bf7aa9ecb09db244162ad Mon Sep 17 00:00:00 2001 From: Yotam Ofek Date: Fri, 3 Sep 2021 21:02:48 +0300 Subject: [PATCH] Update crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs Co-authored-by: Aleksey Kladov --- .../ide_assists/src/handlers/replace_for_loop_with_for_each.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c5bdbfbbe7c7..fcf7973bd0ba 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) {