Skip to content

Commit 755fe4d

Browse files
committed
Auto merge of rust-lang#9834 - koka831:refac/manual-is-ascii-check, r=xFrednet
refac: remove unnecessary mutability refactor `manual_is_ascii_check` lint. * remove unnecessary mutability * fix typo changelog: none r? `@xFrednet`
2 parents cad0d3d + 39398e1 commit 755fe4d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clippy_lints/src/manual_is_ascii_check.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,16 @@ impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck {
9191
CharRange::Digit => Some("is_ascii_digit"),
9292
CharRange::Otherwise => None,
9393
} {
94-
let mut applicability = Applicability::MaybeIncorrect;
9594
let default_snip = "..";
9695
// `snippet_with_applicability` may set applicability to `MaybeIncorrect` for
97-
// macro span, so we check applicability manually by comaring `recv` is not default.
96+
// macro span, so we check applicability manually by comparing `recv` is not default.
9897
let recv = snippet(cx, recv.span, default_snip);
9998

100-
if recv != default_snip {
101-
applicability = Applicability::MachineApplicable;
102-
}
99+
let applicability = if recv == default_snip {
100+
Applicability::HasPlaceholders
101+
} else {
102+
Applicability::MachineApplicable
103+
};
103104

104105
span_lint_and_sugg(
105106
cx,

0 commit comments

Comments
 (0)