mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
Auto merge of #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`
This commit is contained in:
commit
755fe4dc24
1 changed files with 6 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue