diff --git a/src/uu/fmt/src/fmt.rs b/src/uu/fmt/src/fmt.rs index 06016f794..b795ad277 100644 --- a/src/uu/fmt/src/fmt.rs +++ b/src/uu/fmt/src/fmt.rs @@ -21,6 +21,10 @@ mod parasplit; const ABOUT: &str = help_about!("fmt.md"); const USAGE: &str = help_usage!("fmt.md"); const MAX_WIDTH: usize = 2500; +const DEFAULT_GOAL: usize = 70; +const DEFAULT_WIDTH: usize = 75; +// by default, goal is 93% of width +const DEFAULT_GOAL_TO_WIDTH_RATIO: usize = 93; mod options { pub const CROWN_MARGIN: &str = "crown-margin"; @@ -39,9 +43,6 @@ mod options { pub const FILES: &str = "files"; } -// by default, goal is 93% of width -const DEFAULT_GOAL_TO_WIDTH_RATIO: usize = 93; - pub type FileOrStdReader = BufReader>; pub struct FmtOptions { crown: bool, @@ -103,7 +104,7 @@ impl FmtOptions { let w = (g * 100 / DEFAULT_GOAL_TO_WIDTH_RATIO).max(g + 3); (w, g) } - (None, None) => (75, 70), + (None, None) => (DEFAULT_WIDTH, DEFAULT_GOAL), }; debug_assert!(width >= goal, "GOAL {goal} should not be greater than WIDTH {width} when given {width_opt:?} and {goal_opt:?}.");