diff options
| author | Evan Typanski <evan.typanski@microfocus.com> | 2022-06-22 15:26:08 -0400 |
|---|---|---|
| committer | Evan Typanski <evan.typanski@microfocus.com> | 2022-06-22 15:26:08 -0400 |
| commit | 0447cc7affa8c4086c12eafea1b1eda3883f6677 (patch) | |
| tree | 6867be7f38377165ea4dde8adbb55ad3762a797e | |
| parent | 61e1870aff5d77088e487b1506cbf537ac81e63a (diff) | |
| download | rust-0447cc7affa8c4086c12eafea1b1eda3883f6677.tar.gz rust-0447cc7affa8c4086c12eafea1b1eda3883f6677.zip | |
Simplify with let else
| -rw-r--r-- | clippy_lints/src/manual_rem_euclid.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clippy_lints/src/manual_rem_euclid.rs b/clippy_lints/src/manual_rem_euclid.rs index d22397ca35e..29d6027ac02 100644 --- a/clippy_lints/src/manual_rem_euclid.rs +++ b/clippy_lints/src/manual_rem_euclid.rs @@ -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; } } |
