From 5e0b9e0a10c77db3a58eb2fb9f36706892ea1291 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Mon, 1 May 2017 15:43:27 +0100 Subject: [PATCH] =?UTF-8?q?A=20file=E2=80=99s=20colour=20is=20actually=20a?= =?UTF-8?q?=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/output/file_name.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/output/file_name.rs b/src/output/file_name.rs index 9f9080e..e933c32 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -61,7 +61,7 @@ impl<'a, 'dir> FileName<'a, 'dir> { } if !target.name.is_empty() { - bits.push(FileName::new(&target, self.colours).file_colour().paint(target.name)); + bits.push(FileName::new(&target, self.colours).style().paint(target.name)); } }, @@ -113,11 +113,11 @@ impl<'a, 'dir> FileName<'a, 'dir> { /// So in that situation, those characters will be escaped and highlighted in /// a different colour. fn coloured_file_name<'unused>(&self) -> Vec> { - let colour = self.file_colour(); + let file_style = self.style(); let mut bits = Vec::new(); if self.file.name.chars().all(|c| c >= 0x20 as char) { - bits.push(colour.paint(self.file.name.clone())); + bits.push(file_style.paint(self.file.name.clone())); } else { for c in self.file.name.chars() { @@ -129,7 +129,7 @@ impl<'a, 'dir> FileName<'a, 'dir> { // hence the `all` check above. let mut s = String::new(); s.push(c); - bits.push(colour.paint(s)); + bits.push(file_style.paint(s)); } else { let s = c.escape_default().collect::(); bits.push(self.colours.control_char.paint(s)); @@ -140,7 +140,7 @@ impl<'a, 'dir> FileName<'a, 'dir> { bits } - pub fn file_colour(&self) -> Style { + pub fn style(&self) -> Style { match self.file { f if f.is_directory() => self.colours.filetypes.directory, f if f.is_executable_file() => self.colours.filetypes.executable,