Skip to content

Commit da61ebf

Browse files
authored
Merge pull request #7722 from nyurik/fmt-fix
chore: minor fmt match cleanup
2 parents 7e3b8f1 + 74d7958 commit da61ebf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/uu/fmt/src/fmt.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@ impl FmtOptions {
110110
}
111111
(w, g)
112112
}
113-
(Some(w), None) => {
113+
(Some(0), None) => {
114114
// Only allow a goal of zero if the width is set to be zero
115-
let g = (w * DEFAULT_GOAL_TO_WIDTH_RATIO / 100).max(if w == 0 { 0 } else { 1 });
115+
(0, 0)
116+
}
117+
(Some(w), None) => {
118+
let g = (w * DEFAULT_GOAL_TO_WIDTH_RATIO / 100).max(1);
116119
(w, g)
117120
}
118121
(None, Some(g)) => {

0 commit comments

Comments
 (0)