Skip to content

Commit fa7ac9c

Browse files
committed
Reduce FormattingOptions to 64 bits.
1 parent ccb9429 commit fa7ac9c

File tree

2 files changed

+181
-172
lines changed

2 files changed

+181
-172
lines changed

Diff for: library/core/src/fmt/float.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ where
8686
true => flt2dec::Sign::MinusPlus,
8787
};
8888

89-
if let Some(precision) = fmt.options.precision {
89+
if let Some(precision) = fmt.options.get_precision() {
9090
float_to_decimal_common_exact(fmt, num, sign, precision)
9191
} else {
9292
let min_precision = 0;
@@ -162,7 +162,7 @@ where
162162
true => flt2dec::Sign::MinusPlus,
163163
};
164164

165-
if let Some(precision) = fmt.options.precision {
165+
if let Some(precision) = fmt.options.get_precision() {
166166
// 1 integral digit + `precision` fractional digits = `precision + 1` total digits
167167
float_to_exponential_common_exact(fmt, num, sign, precision + 1, upper)
168168
} else {
@@ -180,7 +180,7 @@ where
180180
true => flt2dec::Sign::MinusPlus,
181181
};
182182

183-
if let Some(precision) = fmt.options.precision {
183+
if let Some(precision) = fmt.options.get_precision() {
184184
// this behavior of {:.PREC?} predates exponential formatting for {:?}
185185
float_to_decimal_common_exact(fmt, num, sign, precision)
186186
} else {

0 commit comments

Comments
 (0)