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("always") => PagingMode::Always,
|
||||||
Some("never") => PagingMode::Never,
|
Some("never") => PagingMode::Never,
|
||||||
Some("auto") | None => {
|
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.
|
||||||
// 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;
|
||||||
PagingMode::Never
|
if extra_plain || self.matches.is_present("no-paging") {
|
||||||
} else if self.matches.is_present("no-paging") {
|
|
||||||
PagingMode::Never
|
PagingMode::Never
|
||||||
} else if inputs.iter().any(Input::is_stdin) {
|
} else if inputs.iter().any(Input::is_stdin) {
|
||||||
// If we are reading from stdin, only enable paging if we write to an
|
// If we are reading from stdin, only enable paging if we write to an
|
||||||
|
Loading…
Reference in New Issue
Block a user