about summary refs log tree commit diff
path: root/clippy_lints/src/mutable_debug_assertion.rs
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2023-07-17 10:19:29 +0200
committerPhilipp Krones <hello@philkrones.com>2023-07-17 10:22:32 +0200
commitd6d530fd0b92ccec4a22e69cdebe6c4c942c8166 (patch)
tree6fd75fcf396b1f88a36558cc3534801083610893 /clippy_lints/src/mutable_debug_assertion.rs
parentfdb2e363d33e04aa306041e2c084e13c6ce489e1 (diff)
downloadrust-d6d530fd0b92ccec4a22e69cdebe6c4c942c8166.tar.gz
rust-d6d530fd0b92ccec4a22e69cdebe6c4c942c8166.zip
Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyup
Diffstat (limited to 'clippy_lints/src/mutable_debug_assertion.rs')
-rw-r--r--clippy_lints/src/mutable_debug_assertion.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs
index d8647a99105..dea432fdbd5 100644
--- a/clippy_lints/src/mutable_debug_assertion.rs
+++ b/clippy_lints/src/mutable_debug_assertion.rs
@@ -39,7 +39,9 @@ declare_lint_pass!(DebugAssertWithMutCall => [DEBUG_ASSERT_WITH_MUT_CALL]);
 
 impl<'tcx> LateLintPass<'tcx> for DebugAssertWithMutCall {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
-        let Some(macro_call) = root_macro_call_first_node(cx, e) else { return };
+        let Some(macro_call) = root_macro_call_first_node(cx, e) else {
+            return;
+        };
         let macro_name = cx.tcx.item_name(macro_call.def_id);
         if !matches!(
             macro_name.as_str(),
@@ -47,7 +49,9 @@ impl<'tcx> LateLintPass<'tcx> for DebugAssertWithMutCall {
         ) {
             return;
         }
-        let Some((lhs, rhs, _)) = find_assert_eq_args(cx, e, macro_call.expn) else { return };
+        let Some((lhs, rhs, _)) = find_assert_eq_args(cx, e, macro_call.expn) else {
+            return;
+        };
         for arg in [lhs, rhs] {
             let mut visitor = MutArgVisitor::new(cx);
             visitor.visit_expr(arg);