mirror of
https://github.com/nushell/nushell.git
synced 2024-11-27 02:44:01 +01:00
Fix filesize "B" regression (#2688)
This commit is contained in:
parent
f4d654d2a2
commit
db590369a8
@ -163,7 +163,7 @@ impl PrettyDebug for FormatInlineShape {
|
|||||||
.get("filesize_format")
|
.get("filesize_format")
|
||||||
.map(|val| val.convert_to_string().to_ascii_lowercase())
|
.map(|val| val.convert_to_string().to_ascii_lowercase())
|
||||||
.unwrap_or_else(|| "auto".to_string());
|
.unwrap_or_else(|| "auto".to_string());
|
||||||
// if there is a value match it to one of the valid values for byte units
|
// if there is a value, match it to one of the valid values for byte units
|
||||||
let filesize_format = match filesize_format_var.as_str() {
|
let filesize_format = match filesize_format_var.as_str() {
|
||||||
"b" => (byte_unit::ByteUnit::B, ""),
|
"b" => (byte_unit::ByteUnit::B, ""),
|
||||||
"kb" => (byte_unit::ByteUnit::KB, ""),
|
"kb" => (byte_unit::ByteUnit::KB, ""),
|
||||||
@ -194,7 +194,10 @@ impl PrettyDebug for FormatInlineShape {
|
|||||||
match byte.get_unit() {
|
match byte.get_unit() {
|
||||||
byte_unit::ByteUnit::B => {
|
byte_unit::ByteUnit::B => {
|
||||||
let locale_byte = byte.get_value() as u64;
|
let locale_byte = byte.get_value() as u64;
|
||||||
(b::primitive(locale_byte.to_formatted_string(&Locale::en))).group()
|
(b::primitive(locale_byte.to_formatted_string(&Locale::en))
|
||||||
|
+ b::space()
|
||||||
|
+ b::kind("B"))
|
||||||
|
.group()
|
||||||
}
|
}
|
||||||
_ => b::primitive(byte.format(1)),
|
_ => b::primitive(byte.format(1)),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user