@@ -40,7 +40,7 @@ fn compute_num_digits(input: &str, ebd: ExtendedBigDecimal) -> PreciseNumber {
4040 return PreciseNumber {
4141 number : ebd,
4242 num_integral_digits : 0 ,
43- num_fractional_digits : if input. contains ( "." ) || input. contains ( "p" ) {
43+ num_fractional_digits : if input. contains ( '.' ) || input. contains ( 'p' ) {
4444 None
4545 } else {
4646 Some ( 0 )
@@ -49,17 +49,17 @@ fn compute_num_digits(input: &str, ebd: ExtendedBigDecimal) -> PreciseNumber {
4949 }
5050
5151 // Split the exponent part, if any
52- let parts: Vec < & str > = input. split ( "e" ) . collect ( ) ;
52+ let parts: Vec < & str > = input. split ( 'e' ) . collect ( ) ;
5353 debug_assert ! ( parts. len( ) <= 2 ) ;
5454
5555 // Count all the digits up to `.`, `-` sign is included.
56- let ( mut int_digits, mut frac_digits) = match parts[ 0 ] . find ( "." ) {
56+ let ( mut int_digits, mut frac_digits) = match parts[ 0 ] . find ( '.' ) {
5757 Some ( i) => {
5858 // Cover special case .X and -.X where we behave as if there was a leading 0:
5959 // 0.X, -0.X.
6060 let int_digits = match i {
6161 0 => 1 ,
62- 1 if parts[ 0 ] . starts_with ( "-" ) => 2 ,
62+ 1 if parts[ 0 ] . starts_with ( '-' ) => 2 ,
6363 _ => i,
6464 } ;
6565
@@ -75,7 +75,7 @@ fn compute_num_digits(input: &str, ebd: ExtendedBigDecimal) -> PreciseNumber {
7575 // For positive exponents, effectively expand the number. Ignore negative exponents.
7676 // Also ignore overflowed exponents (unwrap_or(0)).
7777 if exp > 0 {
78- int_digits += exp. try_into ( ) . unwrap_or ( 0 )
78+ int_digits += exp. try_into ( ) . unwrap_or ( 0 ) ;
7979 } ;
8080 frac_digits = if exp < frac_digits as i64 {
8181 // Subtract from i128 to avoid any overflow
@@ -106,7 +106,7 @@ impl FromStr for PreciseNumber {
106106 ebd
107107 }
108108 ExtendedBigDecimal :: Infinity | ExtendedBigDecimal :: MinusInfinity => {
109- return Ok ( PreciseNumber {
109+ return Ok ( Self {
110110 number : ebd,
111111 num_integral_digits : 0 ,
112112 num_fractional_digits : Some ( 0 ) ,
0 commit comments