From 55c609af5f2014da0ed2d1d41bda3fc2ec150e23 Mon Sep 17 00:00:00 2001 From: Will Lane Date: Tue, 24 Nov 2020 13:12:52 -0800 Subject: [PATCH] formatted code to be all aligned the same --- src/main.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6aef89c..62fd5d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,25 +70,25 @@ impl PathType { fn get_color_for_type(&self) -> String { match self { - Self::Dir => format!("{}", termion::color::Fg(termion::color::LightBlue)), - Self::Symlink => format!("{}", termion::color::Fg(termion::color::LightMagenta)), - Self::Path => format!("{}", termion::color::Fg(termion::color::White)), - Self::Pipe => format!("{}", termion::color::Fg(termion::color::Yellow)), - Self::CharD => format!( "{}{}", termion::color::Bg(termion::color::Yellow), termion::color::Fg(termion::color::LightBlue) ), - Self::BlockD => format!("{}", termion::color::Fg(termion::color::LightGreen)), - Self::Socket => format!("{}", termion::color::Fg(termion::color::LightRed)), + Self::Dir => format!("{}" , termion::color::Fg(termion::color::LightBlue)), + Self::Symlink => format!("{}" , termion::color::Fg(termion::color::LightMagenta)), + Self::Path => format!("{}" , termion::color::Fg(termion::color::White)), + Self::Pipe => format!("{}" , termion::color::Fg(termion::color::Yellow)), + Self::CharD => format!("{}{}", termion::color::Bg(termion::color::Yellow), termion::color::Fg(termion::color::LightBlue) ), + Self::BlockD => format!("{}" , termion::color::Fg(termion::color::LightGreen)), + Self::Socket => format!("{}" , termion::color::Fg(termion::color::LightRed)), } } fn get_text_traits_for_type(&self, name: &str, file: &std::path::PathBuf) -> String { match self { - Self::Dir => text_effects::bold(&format!( "{}{}/", name, termion::color::Fg(termion::color::White) )), + Self::Dir => text_effects::bold(&format!( "{}{}/" , name, termion::color::Fg(termion::color::White) )), Self::Symlink => text_effects::italic(&format!( "{} -> {}", name, std::fs::read_link(file).unwrap().display().to_string() )), - Self::Path => text_effects::bold(name), - Self::Pipe => text_effects::bold(&format!( "{}{}|", name, termion::color::Fg(termion::color::White) )), - Self::CharD => text_effects::bold(name), - Self::BlockD => text_effects::bold(name), - Self::Socket => text_effects::bold(&format!( "{}{}=", name, termion::color::Fg(termion::color::White) )), + Self::Path => text_effects::bold(name) , + Self::Pipe => text_effects::bold(&format!( "{}{}" , name, termion::color::Fg(termion::color::White) )), + Self::CharD => text_effects::bold(name) , + Self::BlockD => text_effects::bold(name) , + Self::Socket => text_effects::bold(&format!( "{}{}" , name, termion::color::Fg(termion::color::White) )), } } }