提交 ec84f16d 编写于 作者: D Daniel Lockyer

Collapse down similar branches of match-statement

上级 91459d60
......@@ -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,
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册