mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-05 12:27:53 +00:00
Collapse down similar branches of match-statement
This commit is contained in:
parent
91459d608c
commit
ec84f16da7
@ -91,9 +91,9 @@ impl View {
|
||||
|
||||
if let Some(&width) = term_width.as_ref() {
|
||||
let colours = match term_colours {
|
||||
TerminalColours::Always => Colours::colourful(colour_scale()),
|
||||
TerminalColours::Always
|
||||
| TerminalColours::Automatic => Colours::colourful(colour_scale()),
|
||||
TerminalColours::Never => Colours::plain(),
|
||||
TerminalColours::Automatic => Colours::colourful(colour_scale()),
|
||||
};
|
||||
|
||||
if matches.opt_present("oneline") {
|
||||
@ -137,8 +137,7 @@ impl View {
|
||||
|
||||
let colours = match term_colours {
|
||||
TerminalColours::Always => Colours::colourful(colour_scale()),
|
||||
TerminalColours::Never => Colours::plain(),
|
||||
TerminalColours::Automatic => Colours::plain(),
|
||||
TerminalColours::Never | TerminalColours::Automatic => Colours::plain(),
|
||||
};
|
||||
|
||||
if matches.opt_present("tree") {
|
||||
@ -221,9 +220,9 @@ impl TerminalWidth {
|
||||
|
||||
fn as_ref(&self) -> Option<&usize> {
|
||||
match *self {
|
||||
TerminalWidth::Set(ref width) => Some(width),
|
||||
TerminalWidth::Terminal(ref width) => Some(width),
|
||||
TerminalWidth::Unset => None,
|
||||
TerminalWidth::Set(ref width)
|
||||
| TerminalWidth::Terminal(ref width) => Some(width),
|
||||
TerminalWidth::Unset => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,11 +27,11 @@ impl Column {
|
||||
/// Get the alignment this column should use.
|
||||
pub fn alignment(&self) -> Alignment {
|
||||
match *self {
|
||||
Column::FileSize(_) => Alignment::Right,
|
||||
Column::HardLinks => Alignment::Right,
|
||||
Column::Inode => Alignment::Right,
|
||||
Column::Blocks => Alignment::Right,
|
||||
Column::GitStatus => Alignment::Right,
|
||||
Column::FileSize(_)
|
||||
| Column::HardLinks
|
||||
| Column::Inode
|
||||
| Column::Blocks
|
||||
| Column::GitStatus => Alignment::Right,
|
||||
_ => Alignment::Left,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user