We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 000c3ff + 4e78547 commit ce5d22eCopy full SHA for ce5d22e
clippy_lints/src/literal_representation.rs
@@ -509,17 +509,12 @@ impl DecimalLiteralRepresentation {
509
fn check_lit(self, cx: &EarlyContext<'_>, lit: &Lit) {
510
// Lint integral literals.
511
if_chain! {
512
- if let LitKind::Int(..) = lit.kind;
+ if let LitKind::Int(val, _) = lit.kind;
513
if let Some(src) = snippet_opt(cx, lit.span);
514
if let Some(firstch) = src.chars().next();
515
if char::to_digit(firstch, 10).is_some();
516
let digit_info = DigitInfo::new(&src, false);
517
if digit_info.radix == Radix::Decimal;
518
- if let Ok(val) = digit_info.digits
519
- .chars()
520
- .filter(|&c| c != '_')
521
- .collect::<String>()
522
- .parse::<u128>();
523
if val >= u128::from(self.threshold);
524
then {
525
let hex = format!("{:#X}", val);
0 commit comments