Skip to content

Commit 23e49af

Browse files
committed
Use match_body directly
1 parent 536a7d6 commit 23e49af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/matches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,13 +838,13 @@ fn check_match_single_binding(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[A
838838
match match_body.kind {
839839
ExprKind::Block(block, _) => {
840840
// macro + expr_ty(body) == ()
841-
if block.span.from_expansion() && cx.tables.expr_ty(&arms[0].body).is_unit() {
841+
if block.span.from_expansion() && cx.tables.expr_ty(&match_body).is_unit() {
842842
snippet_body.push(';');
843843
}
844844
},
845845
_ => {
846846
// expr_ty(body) == ()
847-
if cx.tables.expr_ty(&arms[0].body).is_unit() {
847+
if cx.tables.expr_ty(&match_body).is_unit() {
848848
snippet_body.push(';');
849849
}
850850
},

0 commit comments

Comments
 (0)