mirror of
https://github.com/sharkdp/bat.git
synced 2024-12-22 06:20:44 +01:00
Fix format error
This commit is contained in:
parent
154186a58d
commit
9c782fb692
@ -26,9 +26,9 @@ impl OutputType {
|
|||||||
|
|
||||||
/// Try to launch the pager. Fall back to stdout in case of errors.
|
/// Try to launch the pager. Fall back to stdout in case of errors.
|
||||||
fn try_pager(quit_if_one_screen: bool, pager_from_config: Option<&str>) -> Result<Self> {
|
fn try_pager(quit_if_one_screen: bool, pager_from_config: Option<&str>) -> Result<Self> {
|
||||||
let pager_from_env = env::var("BAT_PAGER")
|
let pager_from_env = env::var("BAT_PAGER").or_else(|_| env::var("PAGER"));
|
||||||
.or_else(|_| env::var("PAGER"));
|
let pager = pager_from_config
|
||||||
let pager = pager_from_config.map(|p| p.to_string())
|
.map(|p| p.to_string())
|
||||||
.or(pager_from_env.ok())
|
.or(pager_from_env.ok())
|
||||||
.unwrap_or(String::from("less"));
|
.unwrap_or(String::from("less"));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user