Skip to content

Commit

Permalink
add missing space before unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Error-42 authored and chris-laplante committed Jul 27, 2023
1 parent 257e79f commit a1d1367
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/format.rs
Expand Up @@ -109,7 +109,7 @@ const UNITS: &[(Duration, &str, &str)] = &[
impl fmt::Display for HumanBytes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match NumberPrefix::binary(self.0 as f64) {
NumberPrefix::Standalone(number) => write!(f, "{number:.0}B"),
NumberPrefix::Standalone(number) => write!(f, "{number:.0} B"),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{number:.2} {prefix}B"),
}
}
Expand All @@ -118,7 +118,7 @@ impl fmt::Display for HumanBytes {
impl fmt::Display for DecimalBytes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match NumberPrefix::decimal(self.0 as f64) {
NumberPrefix::Standalone(number) => write!(f, "{number:.0}B"),
NumberPrefix::Standalone(number) => write!(f, "{number:.0} B"),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{number:.2} {prefix}B"),
}
}
Expand All @@ -127,7 +127,7 @@ impl fmt::Display for DecimalBytes {
impl fmt::Display for BinaryBytes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match NumberPrefix::binary(self.0 as f64) {
NumberPrefix::Standalone(number) => write!(f, "{number:.0}B"),
NumberPrefix::Standalone(number) => write!(f, "{number:.0} B"),
NumberPrefix::Prefixed(prefix, number) => write!(f, "{number:.2} {prefix}B"),
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/render.rs
Expand Up @@ -939,7 +939,7 @@ fn progress_bar_terminal_wrap() {
r#" Downloading ⠁ [00:0
0:00] [-------------
--------------------
-------] 0B/0B"#
-------] 0 B/0 B"#
);

let new = min(downloaded + 223211, total_size);
Expand Down

0 comments on commit a1d1367

Please sign in to comment.