Skip to content

Commit

Permalink
formatted code to be all aligned the same
Browse files Browse the repository at this point in the history
  • Loading branch information
willdoescode committed Nov 24, 2020
1 parent 4b6fc53 commit 55c609a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) )),
}
}
}
Expand Down

0 comments on commit 55c609a

Please sign in to comment.