Skip to content

Commit

Permalink
refactor(output): simplify icon style setting in FileName.paint
Browse files Browse the repository at this point in the history
Signed-off-by: Sandro-Alessio Gierens <sandro@gierens.de>
  • Loading branch information
gierens committed Mar 22, 2024
1 parent 731daed commit 16a3302
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/output/file_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> {
};

if let Some(spaces_count) = spaces_count_opt {
let style = iconify_style(match self.colours.icon() {
Some(style) => style,
None => self.style(),
});
let style = iconify_style(self.colours.icon().unwrap_or_else(|| self.style()));
let file_icon = icon_for_file(self.file).to_string();
bits.push(style.paint(file_icon));
bits.push(style.paint(" ".repeat(spaces_count as usize)));
Expand Down

0 comments on commit 16a3302

Please sign in to comment.