Skip to content

Commit be9e6af

Browse files
committed
review comments: use if let
1 parent d2cb5a8 commit be9e6af

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/librustc_mir/hair/pattern/check_match.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,9 @@ fn check_arms<'tcx>(
429429

430430
hir::MatchSource::ForLoopDesugar |
431431
hir::MatchSource::Normal => {
432-
match pat.kind {
433-
box PatternKind::Range(..) => {
434-
// Covered in `is_useful() with more context`
435-
break;
436-
}
437-
_ => {}
432+
if let box PatternKind::Range(..) = pat.kind {
433+
// Covered by `overlapping_patterns` with more context
434+
break;
438435
}
439436
let mut err = cx.tcx.struct_span_lint_hir(
440437
lint::builtin::UNREACHABLE_PATTERNS,

0 commit comments

Comments
 (0)