on master help sign in
Fix clippy::if_same_then_else warning in --paging=auto logic
commit6d1c7d5f57fbccd54499b003c94528a5188d281c authorMartin Nordholts <enselic@gmail.com> dateFri 25 Dec 2020, 12:22 (6 years ago) parent07bd750
1 file changed+3−4
src/bin/bat/app.rs+3−4
src/bin/bat/app.rs+3−4
@@ -82,10 +82,9 @@ impl App {
8282 Some("always") => PagingMode::Always,
8383 Some("never") => PagingMode::Never,
8484 Some("auto") | None => {
85− if self.matches.occurrences_of("plain") > 1 {
86− // If we have -pp as an option when in auto mode, the pager should be disabled.
87− PagingMode::Never
88− } else if self.matches.is_present("no-paging") {
85+ // If we have -pp as an option when in auto mode, the pager should be disabled.
86+ let extra_plain = self.matches.occurrences_of("plain") > 1;
87+ if extra_plain || self.matches.is_present("no-paging") {
8988 PagingMode::Never
9089 } else if inputs.iter().any(Input::is_stdin) {
9190 // If we are reading from stdin, only enable paging if we write to an