diff options
author | IIIIII <github@bigly.dog> | 2022-02-04 01:24:18 -0800 |
---|---|---|
committer | IIIIII <github@bigly.dog> | 2022-02-04 01:24:18 -0800 |
commit | e1f7a3ec3b989711f429c9355234868dfeb29866 (patch) | |
tree | 17e9be0280aed3269c68f4b79283ef8f5f68893c | |
parent | 548f4bb851875be610ad213dd8f2f37e4ba69b91 (diff) |
ok
-rw-r--r-- | src/argparse.rs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/argparse.rs b/src/argparse.rs index 2a82314..7bf9620 100644 --- a/src/argparse.rs +++ b/src/argparse.rs @@ -207,19 +207,18 @@ fn p_fzf(fzf: Option<String>) -> Option<(PathBuf, Vec<String>)> { fn p_pager(pager: &Option<String>) -> Option<SubprocessCommand> { let norm = || which("delta").or_else(|_| which("diff-so-fancy")).ok(); - let (prog, arguments) = match pager { - Some(val) => match val as &str { - "never" => (None, Vec::new()), - _ => { - let mut sh = split(val) - .unwrap_or_else(|| vec![val.to_owned()]) - .into_iter(); - ( - sh.next().and_then(|p| which(p).ok()).or_else(norm), - sh.collect(), - ) - } - }, + + let (prog, arguments) = match pager.as_deref() { + Some("never") => (None, Vec::new()), + Some(val) => { + let mut sh = split(val) + .unwrap_or_else(|| vec![val.to_owned()]) + .into_iter(); + ( + sh.next().and_then(|p| which(p).ok()).or_else(norm), + sh.collect(), + ) + } None => { let val = var_os("GIT_PAGER") .and_then(|v| v.into_string().ok()) |