Skip to content

Commit a9b5b36

Browse files
author
Michael Wright
committed
Fix to_digit_is_some dogfood errors
1 parent 5817a4f commit a9b5b36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/literal_representation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl LiteralDigitGrouping {
364364
if_chain! {
365365
if let Some(src) = snippet_opt(cx, lit.span);
366366
if let Some(firstch) = src.chars().next();
367-
if char::to_digit(firstch, 10).is_some();
367+
if char::is_digit(firstch, 10);
368368
then {
369369
let digit_info = DigitInfo::new(&src, false);
370370
let _ = Self::do_lint(digit_info.digits, digit_info.suffix, in_macro).map_err(|warning_type| {
@@ -378,7 +378,7 @@ impl LiteralDigitGrouping {
378378
if_chain! {
379379
if let Some(src) = snippet_opt(cx, lit.span);
380380
if let Some(firstch) = src.chars().next();
381-
if char::to_digit(firstch, 10).is_some();
381+
if char::is_digit(firstch, 10);
382382
then {
383383
let digit_info = DigitInfo::new(&src, true);
384384
// Separate digits into integral and fractional parts.
@@ -512,7 +512,7 @@ impl DecimalLiteralRepresentation {
512512
if let LitKind::Int(val, _) = lit.kind;
513513
if let Some(src) = snippet_opt(cx, lit.span);
514514
if let Some(firstch) = src.chars().next();
515-
if char::to_digit(firstch, 10).is_some();
515+
if char::is_digit(firstch, 10);
516516
let digit_info = DigitInfo::new(&src, false);
517517
if digit_info.radix == Radix::Decimal;
518518
if val >= u128::from(self.threshold);

0 commit comments

Comments
 (0)