From bbcf4bf738fde3c4259c42fdb8509e3f0b844c90 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Tue, 24 Sep 2024 10:38:32 -0400 Subject: [PATCH] Update clippy_lints/src/manual_ignore_case_cmp.rs Co-authored-by: Fridtjof Stoldt --- clippy_lints/src/manual_ignore_case_cmp.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/manual_ignore_case_cmp.rs b/clippy_lints/src/manual_ignore_case_cmp.rs index 2f3d8b0b8baf..02cf5bffdb16 100644 --- a/clippy_lints/src/manual_ignore_case_cmp.rs +++ b/clippy_lints/src/manual_ignore_case_cmp.rs @@ -111,15 +111,16 @@ impl LateLintPass<'_> for ManualIgnoreCaseCmp { expr.span, "manual case-insensitive ASCII comparison", |diag| { + let mut app = Applicability::MachineApplicable; diag.span_suggestion_verbose( expr.span, "consider using `.eq_ignore_ascii_case()` instead", format!( "{neg}{}.eq_ignore_ascii_case({deref}{})", - snippet(cx, left_span, "_"), - snippet(cx, right_span, "_") + snippet_with_applicability(cx, left_span, "_", &mut app), + snippet_with_applicability(cx, right_span, "_", &mut app) ), - Applicability::MachineApplicable, + app ); }, );