about summary refs log tree commit diff
path: root/clippy_lints/src/mutable_debug_assertion.rs
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2025-03-26 20:38:58 +0100
committerSamuel Tardieu <sam@rfc1149.net>2025-03-27 14:40:44 +0100
commit79c69112dc1dd5803af4e2682552c1ad2dde14ca (patch)
treebcb0ea10bee9603dc677ca29cb7af6d4fa62eb03 /clippy_lints/src/mutable_debug_assertion.rs
parentcd701524701bbc3443a007b52edcee6550abb0be (diff)
Apply `collapsible_if` to Clippy itself
Since Clippy uses the `let_chains` feature, there are many occasions to
collapse `if` and `if let` statements.
Diffstat (limited to 'clippy_lints/src/mutable_debug_assertion.rs')
-rw-r--r--clippy_lints/src/mutable_debug_assertion.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs
index 3d943bf5b37..d5bed54f0be 100644
--- a/clippy_lints/src/mutable_debug_assertion.rs
+++ b/clippy_lints/src/mutable_debug_assertion.rs
@@ -97,14 +97,13 @@ impl<'tcx> Visitor<'tcx> for MutArgVisitor<'_, 'tcx> {
                 return;
             },
             ExprKind::Path(_) => {
-                if let Some(adj) = self.cx.typeck_results().adjustments().get(expr.hir_id) {
-                    if adj
+                if let Some(adj) = self.cx.typeck_results().adjustments().get(expr.hir_id)
+                    && adj
                         .iter()
                         .any(|a| matches!(a.target.kind(), ty::Ref(_, _, Mutability::Mut)))
-                    {
-                        self.found = true;
-                        return;
-                    }
+                {
+                    self.found = true;
+                    return;
                 }
             },
             // Don't check await desugars