From 6d1c7d5f57fbccd54499b003c94528a5188d281c Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Fri, 25 Dec 2020 12:22:35 +0100 Subject: [PATCH] Fix clippy::if_same_then_else warning in --paging=auto logic --- src/bin/bat/app.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index a25e41d2..c7b9d81d 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -82,10 +82,9 @@ impl App { Some("always") => PagingMode::Always, Some("never") => PagingMode::Never, 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 - } else if self.matches.is_present("no-paging") { + // If we have -pp as an option when in auto mode, the pager should be disabled. + let extra_plain = self.matches.occurrences_of("plain") > 1; + if extra_plain || self.matches.is_present("no-paging") { PagingMode::Never } else if inputs.iter().any(Input::is_stdin) { // If we are reading from stdin, only enable paging if we write to an