From 39398e163ac7508b585f07821e5be195102a4017 Mon Sep 17 00:00:00 2001 From: koka Date: Sat, 12 Nov 2022 19:15:21 +0900 Subject: [PATCH] fix: use HasPlaceholders * remove unnecessary mutability * fix typo --- clippy_lints/src/manual_is_ascii_check.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/clippy_lints/src/manual_is_ascii_check.rs b/clippy_lints/src/manual_is_ascii_check.rs index 3a6b693f7..bb8c142f8 100644 --- a/clippy_lints/src/manual_is_ascii_check.rs +++ b/clippy_lints/src/manual_is_ascii_check.rs @@ -91,15 +91,16 @@ impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck { CharRange::Digit => Some("is_ascii_digit"), CharRange::Otherwise => None, } { - let mut applicability = Applicability::MaybeIncorrect; let default_snip = ".."; // `snippet_with_applicability` may set applicability to `MaybeIncorrect` for - // macro span, so we check applicability manually by comaring `recv` is not default. + // macro span, so we check applicability manually by comparing `recv` is not default. let recv = snippet(cx, recv.span, default_snip); - if recv != default_snip { - applicability = Applicability::MachineApplicable; - } + let applicability = if recv == default_snip { + Applicability::HasPlaceholders + } else { + Applicability::MachineApplicable + }; span_lint_and_sugg( cx,