From 81488adf8b4a6b528f76c1b18ebd1da134db2cc3 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Fri, 24 Apr 2020 16:09:15 +0200 Subject: =?UTF-8?q?Use=20unreachable!(=E2=80=A6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/bat/app.rs | 8 ++++---- 1 file 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. -- cgit v1.2.3