mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
chore: minor fmt match cleanup
Fix an overly complex case when w is 0. Note that this might have been an error - I kept the logic, but the initial implementation might have been incorrect.
This commit is contained in:
parent
5bfbc30fba
commit
74d79589f4
1 changed files with 5 additions and 2 deletions
|
@ -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)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue