Skip to content

Commit 8ab371e

Browse files
Auto-format: cargo fmt --all
1 parent ab683ae commit 8ab371e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

crates/common/src/format.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,7 @@ impl FormatSpec {
561561
},
562562
};
563563

564-
self.format_sign_and_align(
565-
&AsciiStr::new(&magnitude_str),
566-
sign_str,
567-
FormatAlign::Right,
568-
)
564+
self.format_sign_and_align(&AsciiStr::new(&magnitude_str), sign_str, FormatAlign::Right)
569565
}
570566

571567
/// Format a float with locale-aware 'n' format.
@@ -637,9 +633,7 @@ impl FormatSpec {
637633

638634
let precision = self.precision.unwrap_or(6);
639635
let format_type = match self.format_type {
640-
Some(FormatType::Number(case)) => {
641-
FormatType::GeneralFormat(case)
642-
}
636+
Some(FormatType::Number(case)) => FormatType::GeneralFormat(case),
643637
_ => return self.format_complex(num),
644638
};
645639

@@ -672,7 +666,11 @@ impl FormatSpec {
672666

673667
let has_re = re_str.is_some();
674668
let formatted = if let Some(re_str) = re_str {
675-
let sep = if num.im >= 0.0 || num.im.is_nan() { "+" } else { "" };
669+
let sep = if num.im >= 0.0 || num.im.is_nan() {
670+
"+"
671+
} else {
672+
""
673+
};
676674
format!("({re_str}{sep}{im_sign}{im_grouped}j)")
677675
} else {
678676
format!("{im_sign}{im_grouped}j")

0 commit comments

Comments
 (0)