From 17e27776ea152509e1095bbf80f5af65bc7a7997 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 4 May 2020 12:24:24 +0200 Subject: Add a -log-before & -log-after predicate With the file name heuristic for -before and -after in place, we might want a way for the user to disable it. For now, we simply do this by providing a new set of predicates without the filter. In the future, we might have a --disable-heuristics switch to disable the heuristics, in case we ever add more. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index ad35d20..625e869 100644 --- a/src/main.rs +++ b/src/main.rs @@ -344,7 +344,7 @@ fn maybe_save_history(rl: &Editor<()>, path: Option<&Path>) { debug!("Saving history to {:?}", path); let parent = path .parent() - .ok_or(anyhow!("Path does not have a parent"))?; + .ok_or_else(|| anyhow!("Path does not have a parent"))?; fs::create_dir_all(parent).context("Could not create directory")?; rl.save_history(path)?; Ok(()) -- cgit v1.2.3