1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #7722 from nyurik/fmt-fix

chore: minor fmt match cleanup
This commit is contained in:
Daniel Hofstetter 2025-04-11 10:20:30 +02:00 committed by GitHub
commit da61ebf1f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,9 +110,12 @@ impl FmtOptions {
}
(w, g)
}
(Some(w), None) => {
(Some(0), None) => {
// Only allow a goal of zero if the width is set to be zero
let g = (w * DEFAULT_GOAL_TO_WIDTH_RATIO / 100).max(if w == 0 { 0 } else { 1 });
(0, 0)
}
(Some(w), None) => {
let g = (w * DEFAULT_GOAL_TO_WIDTH_RATIO / 100).max(1);
(w, g)
}
(None, Some(g)) => {