Simplify with let else

This commit is contained in:
Evan Typanski 2022-06-22 15:26:08 -04:00
parent 61e1870aff
commit 0447cc7aff

View File

@ -71,11 +71,8 @@ impl<'tcx> LateLintPass<'tcx> for ManualRemEuclid {
match cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
Some(Node::Param(..)) => (),
Some(Node::Local(local)) => {
if let Some(ty) = local.ty {
if matches!(ty.kind, TyKind::Infer) {
return;
}
} else {
let Some(ty) = local.ty else { return };
if matches!(ty.kind, TyKind::Infer) {
return;
}
}