Use formatter to fmt fs entries instead of fmt::Display trait

This commit is contained in:
veeso
2021-01-23 15:51:46 +01:00
parent c1f6308795
commit da0d5231bf
5 changed files with 59 additions and 275 deletions

View File

@@ -169,7 +169,7 @@ impl FileTransferActivity {
let files: Vec<ListItem> = self
.local
.iter_files()
.map(|entry: &FsEntry| ListItem::new(Span::from(format!("{}", entry))))
.map(|entry: &FsEntry| ListItem::new(Span::from(self.local.fmt_file(entry))))
.collect();
// Get colors to use; highlight element inverting fg/bg only when tab is active
let (fg, bg): (Color, Color) = match self.tab {
@@ -209,7 +209,7 @@ impl FileTransferActivity {
let files: Vec<ListItem> = self
.remote
.iter_files()
.map(|entry: &FsEntry| ListItem::new(Span::from(format!("{}", entry))))
.map(|entry: &FsEntry| ListItem::new(Span::from(self.remote.fmt_file(entry))))
.collect();
// Get colors to use; highlight element inverting fg/bg only when tab is active
let (fg, bg): (Color, Color) = match self.tab {