diff options
author | Daniel <kingdread@gmx.de> | 2020-05-04 12:24:24 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-05-04 12:24:24 +0200 |
commit | 17e27776ea152509e1095bbf80f5af65bc7a7997 (patch) | |
tree | 054f71f588a617fd4f0af5ceaf2cc08d401c89b1 /src/main.rs | |
parent | 5aa264ca62efc17e3d55af616aa752c1d24573a2 (diff) | |
download | raidgrep-17e27776ea152509e1095bbf80f5af65bc7a7997.tar.gz raidgrep-17e27776ea152509e1095bbf80f5af65bc7a7997.tar.bz2 raidgrep-17e27776ea152509e1095bbf80f5af65bc7a7997.zip |
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.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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(()) |