on master help sign in
Fix clippy::if_same_then_else warning in --paging=auto logic
6d1c7d5Martin Nordholts
src/bin/bat/app.rs+3−4
@@ -82,10 +82,9 @@ impl App {
82 Some("always") => PagingMode::Always,
82 Some("always") => PagingMode::Always,
83 Some("never") => PagingMode::Never,
83 Some("never") => PagingMode::Never,
84 Some("auto") | None => {
84 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.
85+ // If we have -pp as an option when in auto mode, the pager should be disabled.
87− PagingMode::Never
86+ let extra_plain = self.matches.occurrences_of("plain") > 1;
88− } else if self.matches.is_present("no-paging") {
87+ if extra_plain || self.matches.is_present("no-paging") {
89 PagingMode::Never
88 PagingMode::Never
90 } else if inputs.iter().any(Input::is_stdin) {
89 } else if inputs.iter().any(Input::is_stdin) {
91 // If we are reading from stdin, only enable paging if we write to an
90 // If we are reading from stdin, only enable paging if we write to an