Skip to content

Commit 0447cc7

Browse files
author
Evan Typanski
committed
Simplify with let else
1 parent 61e1870 commit 0447cc7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clippy_lints/src/manual_rem_euclid.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,8 @@ impl<'tcx> LateLintPass<'tcx> for ManualRemEuclid {
7171
match cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
7272
Some(Node::Param(..)) => (),
7373
Some(Node::Local(local)) => {
74-
if let Some(ty) = local.ty {
75-
if matches!(ty.kind, TyKind::Infer) {
76-
return;
77-
}
78-
} else {
74+
let Some(ty) = local.ty else { return };
75+
if matches!(ty.kind, TyKind::Infer) {
7976
return;
8077
}
8178
}

0 commit comments

Comments
 (0)