summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-04-24 16:09:15 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-04-24 16:11:05 +0200
commit81488adf8b4a6b528f76c1b18ebd1da134db2cc3 (patch)
treee209bb816d4aca90ddbe97d0b182fbfc159239cd
parente37e9c12141a40fc65c207a501dad24f11709ee0 (diff)
Use unreachable!(…)
-rw-r--r--src/bin/bat/app.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs
index d01f756d..8eab9e45 100644
--- a/src/bin/bat/app.rs
+++ b/src/bin/bat/app.rs
@@ -80,8 +80,7 @@ impl App {
let paging_mode = match self.matches.value_of("paging") {
Some("always") => PagingMode::Always,
Some("never") => PagingMode::Never,
- // FIXME: `_` will always cover in or patterns
- Some("auto") | _ => {
+ Some("auto") | None => {
if self.matches.occurrences_of("plain") > 1 {
// If we have -pp as an option when in auto mode, the pager should be disabled.
PagingMode::Never
@@ -100,6 +99,7 @@ impl App {
PagingMode::Never
}
}
+ _ => unreachable!("other values for --paging are not allowed"),
};
let mut syntax_mapping = SyntaxMapping::builtin();
@@ -148,14 +148,14 @@ impl App {
match self.matches.value_of("wrap") {
Some("character") => WrappingMode::Character,
Some("never") => WrappingMode::NoWrapping,
- // FIXME: `_` will always cover in or patterns
- Some("auto") | _ => {
+ Some("auto") | None => {
if style_components.plain() {
WrappingMode::NoWrapping
} else {
WrappingMode::Character
}
}
+ _ => unreachable!("other values for --paging are not allowed"),
}
} else {
// We don't have the tty width when piping to another program.