Skip to content

Commit dd9433c

Browse files
yotamofekmatklad
andauthored
Update crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs
Co-authored-by: Aleksey Kladov <[email protected]>
1 parent 0d453cc commit dd9433c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(crate) fn replace_for_loop_with_for_each(acc: &mut Assists, ctx: &AssistCont
5050
// We have either "for x in &col" and col implements a method called iter
5151
// or "for x in &mut col" and col implements a method called iter_mut
5252
format_to!(buf, "{}.{}()", expr_behind_ref, method);
53-
} else if matches!(iterable, ast::Expr::RangeExpr(..)) {
53+
} else if let ast::Expr::RangeExpr(..) = iterable {
5454
// range expressions need to be parenthesized for the syntax to be correct
5555
format_to!(buf, "({})", iterable);
5656
} else if impls_core_iter(&ctx.sema, &iterable) {

0 commit comments

Comments
 (0)