mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 14:38:46 +00:00
fix: use HasPlaceholders
* remove unnecessary mutability * fix typo
This commit is contained in:
parent
cad0d3d6da
commit
39398e163a
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::Digit => Some("is_ascii_digit"),
|
||||||
CharRange::Otherwise => None,
|
CharRange::Otherwise => None,
|
||||||
} {
|
} {
|
||||||
let mut applicability = Applicability::MaybeIncorrect;
|
|
||||||
let default_snip = "..";
|
let default_snip = "..";
|
||||||
// `snippet_with_applicability` may set applicability to `MaybeIncorrect` for
|
// `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);
|
let recv = snippet(cx, recv.span, default_snip);
|
||||||
|
|
||||||
if recv != default_snip {
|
let applicability = if recv == default_snip {
|
||||||
applicability = Applicability::MachineApplicable;
|
Applicability::HasPlaceholders
|
||||||
}
|
} else {
|
||||||
|
Applicability::MachineApplicable
|
||||||
|
};
|
||||||
|
|
||||||
span_lint_and_sugg(
|
span_lint_and_sugg(
|
||||||
cx,
|
cx,
|
||||||
|
|
Loading…
Add table
Reference in a new issue