This commit is contained in:
Unknown 2018-12-12 09:34:59 +02:00 committed by Pierre Peltier
parent 29ee29eccc
commit 917498022e
2 changed files with 4 additions and 3 deletions

View file

@ -15,7 +15,7 @@ pub use self::owner::Owner;
pub use self::permissions::Permissions;
pub use self::size::Size;
pub use self::symlink::SymLink;
pub use icon::{Icons};
pub use icon::Icons;
use std::fs::read_link;
use std::path::PathBuf;

View file

@ -38,9 +38,10 @@ impl Name {
}
pub fn render(&self, colors: &Colors, icons: &Icons) -> ColoredString {
let mut content = String::with_capacity(4 /*for the icon*/ + ICON_SPACE.len() +self.name.len() + 3 /* spaces */);
let icon = icons.get(self);
let mut content = String::with_capacity(icon.len() + ICON_SPACE.len() +self.name.len() + 3 /* spaces */);
content += icons.get(self);
content += icon;
content += ICON_SPACE;
let elem = match self.file_type {