fix regression causing size short to have space

This commit is contained in:
Abin Simon 2020-01-28 15:30:29 +05:30
parent 549f559305
commit 20a6a09695

View file

@ -57,14 +57,13 @@ impl Size {
left_pad.push(' '); left_pad.push(' ');
} }
let strings: &[ColoredString] = &[ let mut strings: Vec<ColoredString> = vec![ColoredString::from(left_pad), val_content];
ColoredString::from(left_pad), if flags.size != SizeFlag::Short {
val_content, strings.push(ColoredString::from(" "));
ColoredString::from(" "), }
unit_content, strings.push(unit_content);
];
let res = ANSIStrings(strings).to_string(); let res = ANSIStrings(&strings).to_string();
ColoredString::from(res) ColoredString::from(res)
} }