File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -480,7 +480,7 @@ impl Cursor<'_> {
480
480
match self . first ( ) {
481
481
'e' | 'E' => {
482
482
self . bump ( ) ;
483
- empty_exponent = self . float_exponent ( ) . is_err ( )
483
+ empty_exponent = ! self . eat_float_exponent ( ) ;
484
484
}
485
485
_ => ( ) ,
486
486
}
@@ -489,7 +489,7 @@ impl Cursor<'_> {
489
489
}
490
490
'e' | 'E' => {
491
491
self . bump ( ) ;
492
- let empty_exponent = self . float_exponent ( ) . is_err ( ) ;
492
+ let empty_exponent = ! self . eat_float_exponent ( ) ;
493
493
Float { base, empty_exponent }
494
494
}
495
495
_ => Int { base, empty_int : false } ,
@@ -662,12 +662,14 @@ impl Cursor<'_> {
662
662
has_digits
663
663
}
664
664
665
- fn float_exponent ( & mut self ) -> Result < ( ) , ( ) > {
665
+ /// Eats the float exponent. Returns true if at least one digit was met,
666
+ /// and returns false otherwise.
667
+ fn eat_float_exponent ( & mut self ) -> bool {
666
668
debug_assert ! ( self . prev( ) == 'e' || self . prev( ) == 'E' ) ;
667
669
if self . first ( ) == '-' || self . first ( ) == '+' {
668
670
self . bump ( ) ;
669
671
}
670
- if self . eat_decimal_digits ( ) { Ok ( ( ) ) } else { Err ( ( ) ) }
672
+ self . eat_decimal_digits ( )
671
673
}
672
674
673
675
// Eats the suffix of the literal, e.g. "_u8".
You can’t perform that action at this time.
0 commit comments