diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-04 13:31:07 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-04 13:31:07 +0530 |
commit | a5c8e37b970169913ab72ea691b89aeeeffad403 (patch) | |
tree | 8f72853e8cbd6d3e3e01bef5e05969c364deb5e5 /src/aggregate.rs | |
parent | 7d451f968908549babd06e7858d7a5263b1737a3 (diff) |
Properly fix byte column width handling
Diffstat (limited to 'src/aggregate.rs')
-rw-r--r-- | src/aggregate.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/aggregate.rs b/src/aggregate.rs index 6b616e8..6ca9820 100644 --- a/src/aggregate.rs +++ b/src/aggregate.rs @@ -112,8 +112,8 @@ fn write_path<C: fmt::Display>( ) -> Result<(), io::Error> { writeln!( out, - "{byte_color}{:>10}{byte_color_reset}\t{path_color}{}{path_color_reset}{}", - options.byte_format.display(num_bytes), + "{byte_color}{:>byte_column_width$}{byte_color_reset} {path_color}{}{path_color_reset}{}", + options.byte_format.display(num_bytes).to_string(), // needed for formatting to work (unless we implement it ourselves path.as_ref().display(), if num_errors == 0 { Cow::Borrowed("") @@ -124,6 +124,7 @@ fn write_path<C: fmt::Display>( byte_color_reset = options.color.display(color::Fg(color::Reset)), path_color = options.color.display(path_color), path_color_reset = options.color.display(color::Fg(color::Reset)), + byte_column_width = options.byte_format.width() ) } |