@@ -393,34 +393,19 @@ where
393393 /// Test if a digit is of a certain radix.
394394 fn is_digit_of_radix ( c : Option < char > , radix : u32 ) -> bool {
395395 match radix {
396- 2 => match c {
397- Some ( '0' ..='1' ) => true ,
398- _ => false ,
399- } ,
400- 8 => match c {
401- Some ( '0' ..='7' ) => true ,
402- _ => false ,
403- } ,
404- 10 => match c {
405- Some ( '0' ..='9' ) => true ,
406- _ => false ,
407- } ,
408- 16 => match c {
409- Some ( '0' ..='9' ) | Some ( 'a' ..='f' ) | Some ( 'A' ..='F' ) => true ,
410- _ => false ,
411- } ,
412- x => unimplemented ! ( "Radix not implemented: {}" , x) ,
396+ 2 => matches ! ( c, Some ( '0' ..='1' ) ) ,
397+ 8 => matches ! ( c, Some ( '0' ..='7' ) ) ,
398+ 10 => matches ! ( c, Some ( '0' ..='9' ) ) ,
399+ 16 => matches ! ( c, Some ( '0' ..='9' ) | Some ( 'a' ..='f' ) | Some ( 'A' ..='F' ) ) ,
400+ other => unimplemented ! ( "Radix not implemented: {}" , other) ,
413401 }
414402 }
415403
416404 /// Test if we face '[eE][-+]?[0-9]+'
417405 fn at_exponent ( & self ) -> bool {
418406 match self . chr0 {
419407 Some ( 'e' ) | Some ( 'E' ) => match self . chr1 {
420- Some ( '+' ) | Some ( '-' ) => match self . chr2 {
421- Some ( '0' ..='9' ) => true ,
422- _ => false ,
423- } ,
408+ Some ( '+' ) | Some ( '-' ) => matches ! ( self . chr2, Some ( '0' ..='9' ) ) ,
424409 Some ( '0' ..='9' ) => true ,
425410 _ => false ,
426411 } ,
0 commit comments