Skip to content

Commit c0fa6a9

Browse files
committed
literal_representation: Delay macro check.
1 parent 15f640a commit c0fa6a9

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

clippy_lints/src/literal_representation.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,9 @@ impl_lint_pass!(LiteralDigitGrouping => [
233233

234234
impl EarlyLintPass for LiteralDigitGrouping {
235235
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
236-
if in_external_macro(cx.sess(), expr.span) {
237-
return;
238-
}
239-
240-
if let ExprKind::Lit(lit) = expr.kind {
236+
if let ExprKind::Lit(lit) = expr.kind
237+
&& !in_external_macro(cx.sess(), expr.span)
238+
{
241239
self.check_lit(cx, lit, expr.span);
242240
}
243241
}
@@ -448,11 +446,9 @@ impl_lint_pass!(DecimalLiteralRepresentation => [DECIMAL_LITERAL_REPRESENTATION]
448446

449447
impl EarlyLintPass for DecimalLiteralRepresentation {
450448
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
451-
if in_external_macro(cx.sess(), expr.span) {
452-
return;
453-
}
454-
455-
if let ExprKind::Lit(lit) = expr.kind {
449+
if let ExprKind::Lit(lit) = expr.kind
450+
&& !in_external_macro(cx.sess(), expr.span)
451+
{
456452
self.check_lit(cx, lit, expr.span);
457453
}
458454
}

0 commit comments

Comments
 (0)