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<'_> {
480480 match self . first ( ) {
481481 'e' | 'E' => {
482482 self . bump ( ) ;
483- empty_exponent = self . float_exponent ( ) . is_err ( )
483+ empty_exponent = ! self . eat_float_exponent ( ) ;
484484 }
485485 _ => ( ) ,
486486 }
@@ -489,7 +489,7 @@ impl Cursor<'_> {
489489 }
490490 'e' | 'E' => {
491491 self . bump ( ) ;
492- let empty_exponent = self . float_exponent ( ) . is_err ( ) ;
492+ let empty_exponent = ! self . eat_float_exponent ( ) ;
493493 Float { base, empty_exponent }
494494 }
495495 _ => Int { base, empty_int : false } ,
@@ -662,12 +662,14 @@ impl Cursor<'_> {
662662 has_digits
663663 }
664664
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 {
666668 debug_assert ! ( self . prev( ) == 'e' || self . prev( ) == 'E' ) ;
667669 if self . first ( ) == '-' || self . first ( ) == '+' {
668670 self . bump ( ) ;
669671 }
670- if self . eat_decimal_digits ( ) { Ok ( ( ) ) } else { Err ( ( ) ) }
672+ self . eat_decimal_digits ( )
671673 }
672674
673675 // Eats the suffix of the literal, e.g. "_u8".
You can’t perform that action at this time.
0 commit comments