Skip to content

Commit 44e9e54

Browse files
committed
Cleaner code for unsep literals
1 parent 7ae6920 commit 44e9e54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clippy_lints/src/misc_early.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ impl EarlyLintPass for MiscEarlyLints {
390390

391391
impl MiscEarlyLints {
392392
fn check_lit(self, cx: &EarlyContext<'_>, lit: &Lit) {
393+
if in_external_macro(cx.sess(), lit.span) {
394+
return;
395+
}
396+
393397
if let LitKind::Int(value, lit_int_type) = lit.node {
394398
if let Some(src) = snippet_opt(cx, lit.span) {
395399
let suffix = match lit_int_type {
@@ -440,7 +444,7 @@ impl MiscEarlyLints {
440444
|db| {
441445
db.span_suggestion(
442446
lit.span,
443-
"if you mean to use a decimal constant, remove the `0` to remove confusion",
447+
"if you mean to use a decimal constant, remove the `0` to avoid confusion",
444448
src.trim_start_matches(|c| c == '_' || c == '0').to_string(),
445449
Applicability::MaybeIncorrect,
446450
);

0 commit comments

Comments
 (0)