mirror of
https://github.com/sharkdp/bat
synced 2024-11-15 00:12:57 +00:00
Fix clippy::if_same_then_else warning in --paging=auto logic
This commit is contained in:
parent
07bd7503c5
commit
6d1c7d5f57
@ -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") {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user