Skip to content

Commit 4b16438

Browse files
nyurikxFrednet
andcommitted
Update clippy_lints/src/manual_ignore_case_cmp.rs
Co-authored-by: Fridtjof Stoldt <[email protected]>
1 parent 7b0623d commit 4b16438

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_lints/src/manual_ignore_case_cmp.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,16 @@ impl LateLintPass<'_> for ManualIgnoreCaseCmp {
111111
expr.span,
112112
"manual case-insensitive ASCII comparison",
113113
|diag| {
114+
let mut app = Applicability::MachineApplicable;
114115
diag.span_suggestion_verbose(
115116
expr.span,
116117
"consider using `.eq_ignore_ascii_case()` instead",
117118
format!(
118119
"{neg}{}.eq_ignore_ascii_case({deref}{})",
119-
snippet(cx, left_span, "_"),
120-
snippet(cx, right_span, "_")
120+
snippet_with_applicability(cx, left_span, "_", &mut app),
121+
snippet_with_applicability(cx, right_span, "_", &mut app)
121122
),
122-
Applicability::MachineApplicable,
123+
app
123124
);
124125
},
125126
);

0 commit comments

Comments
 (0)