diff options
| author | Josh Stone <jistone@redhat.com> | 2020-04-16 12:44:57 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2020-04-16 12:44:57 -0700 |
| commit | 2edd123a233fff2fbccd17299e0c14d2203e1acc (patch) | |
| tree | 0a17e3a35ef2901f28cc637693889a057f77910f /src/libcore/num | |
| parent | 7fb5187d0423f4cd0441526571b8cd61927123c9 (diff) | |
Dogfood or_patterns in the standard library
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/dec2flt/parse.rs | 4 | ||||
| -rw-r--r-- | src/libcore/num/flt2dec/mod.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/num/dec2flt/parse.rs b/src/libcore/num/dec2flt/parse.rs index 93b08bce853..2766843155a 100644 --- a/src/libcore/num/dec2flt/parse.rs +++ b/src/libcore/num/dec2flt/parse.rs @@ -54,7 +54,7 @@ pub fn parse_decimal(s: &str) -> ParseResult<'_> { match s.first() { None => Valid(Decimal::new(integral, b"", 0)), - Some(&b'e') | Some(&b'E') => { + Some(&b'e' | &b'E') => { if integral.is_empty() { return Invalid; // No digits before 'e' } @@ -70,7 +70,7 @@ pub fn parse_decimal(s: &str) -> ParseResult<'_> { match s.first() { None => Valid(Decimal::new(integral, fractional, 0)), - Some(&b'e') | Some(&b'E') => parse_exp(integral, fractional, &s[1..]), + Some(&b'e' | &b'E') => parse_exp(integral, fractional, &s[1..]), _ => Invalid, // Trailing junk after fractional part } } diff --git a/src/libcore/num/flt2dec/mod.rs b/src/libcore/num/flt2dec/mod.rs index f5cd26a1852..9adea94e87d 100644 --- a/src/libcore/num/flt2dec/mod.rs +++ b/src/libcore/num/flt2dec/mod.rs @@ -422,14 +422,14 @@ fn determine_sign(sign: Sign, decoded: &FullDecoded, negative: bool) -> &'static "+" } } - (_, Sign::Minus) | (_, Sign::MinusRaw) => { + (_, Sign::Minus | Sign::MinusRaw) => { if negative { "-" } else { "" } } - (_, Sign::MinusPlus) | (_, Sign::MinusPlusRaw) => { + (_, Sign::MinusPlus | Sign::MinusPlusRaw) => { if negative { "-" } else { |
