diff options
| author | xFrednet <xFrednet@gmail.com> | 2024-07-21 19:53:22 +0200 |
|---|---|---|
| committer | xFrednet <xFrednet@gmail.com> | 2024-07-22 19:47:34 +0200 |
| commit | d17f113474fc18284bc7ab0d67a815a220244a3e (patch) | |
| tree | 5720c9604edd3e8f6e846a1074c46e025591a5c1 /clippy_lints/src/missing_assert_message.rs | |
| parent | bc8fc6b1d8abc1c1265da805534a4f172b1fe5d9 (diff) | |
Make restriction lint's use `span_lint_and_then` (m -> m)
Diffstat (limited to 'clippy_lints/src/missing_assert_message.rs')
| -rw-r--r-- | clippy_lints/src/missing_assert_message.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clippy_lints/src/missing_assert_message.rs b/clippy_lints/src/missing_assert_message.rs index 935ed48dacc..a9ea11f4c2b 100644 --- a/clippy_lints/src/missing_assert_message.rs +++ b/clippy_lints/src/missing_assert_message.rs @@ -1,4 +1,4 @@ -use clippy_utils::diagnostics::span_lint_and_help; +use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::is_in_test; use clippy_utils::macros::{find_assert_args, find_assert_eq_args, root_macro_call_first_node, PanicExpn}; use rustc_hir::Expr; @@ -79,13 +79,15 @@ impl<'tcx> LateLintPass<'tcx> for MissingAssertMessage { }; if let PanicExpn::Empty = panic_expn { - span_lint_and_help( + #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] + span_lint_and_then( cx, MISSING_ASSERT_MESSAGE, macro_call.span, "assert without any message", - None, - "consider describing why the failing assert is problematic", + |diag| { + diag.help("consider describing why the failing assert is problematic"); + }, ); } } |
