mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-17 02:01:04 +01:00
Use unreachable!(…)
This commit is contained in:
parent
e37e9c1214
commit
81488adf8b
@ -80,8 +80,7 @@ impl App {
|
|||||||
let paging_mode = match self.matches.value_of("paging") {
|
let paging_mode = match self.matches.value_of("paging") {
|
||||||
Some("always") => PagingMode::Always,
|
Some("always") => PagingMode::Always,
|
||||||
Some("never") => PagingMode::Never,
|
Some("never") => PagingMode::Never,
|
||||||
// FIXME: `_` will always cover in or patterns
|
Some("auto") | None => {
|
||||||
Some("auto") | _ => {
|
|
||||||
if self.matches.occurrences_of("plain") > 1 {
|
if self.matches.occurrences_of("plain") > 1 {
|
||||||
// If we have -pp as an option when in auto mode, the pager should be disabled.
|
// If we have -pp as an option when in auto mode, the pager should be disabled.
|
||||||
PagingMode::Never
|
PagingMode::Never
|
||||||
@ -100,6 +99,7 @@ impl App {
|
|||||||
PagingMode::Never
|
PagingMode::Never
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_ => unreachable!("other values for --paging are not allowed"),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut syntax_mapping = SyntaxMapping::builtin();
|
let mut syntax_mapping = SyntaxMapping::builtin();
|
||||||
@ -148,14 +148,14 @@ impl App {
|
|||||||
match self.matches.value_of("wrap") {
|
match self.matches.value_of("wrap") {
|
||||||
Some("character") => WrappingMode::Character,
|
Some("character") => WrappingMode::Character,
|
||||||
Some("never") => WrappingMode::NoWrapping,
|
Some("never") => WrappingMode::NoWrapping,
|
||||||
// FIXME: `_` will always cover in or patterns
|
Some("auto") | None => {
|
||||||
Some("auto") | _ => {
|
|
||||||
if style_components.plain() {
|
if style_components.plain() {
|
||||||
WrappingMode::NoWrapping
|
WrappingMode::NoWrapping
|
||||||
} else {
|
} else {
|
||||||
WrappingMode::Character
|
WrappingMode::Character
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_ => unreachable!("other values for --paging are not allowed"),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We don't have the tty width when piping to another program.
|
// We don't have the tty width when piping to another program.
|
||||||
|
Loading…
Reference in New Issue
Block a user