Skip to content

Commit

Permalink
Update clippy_lints/src/manual_ignore_case_cmp.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>
  • Loading branch information
nyurik and xFrednet authored Sep 24, 2024
1 parent bb037a2 commit bbcf4bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clippy_lints/src/manual_ignore_case_cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
},
);
Expand Down

0 comments on commit bbcf4bf

Please sign in to comment.