aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-05-04 12:24:24 +0200
committerDaniel <kingdread@gmx.de>2020-05-04 12:24:24 +0200
commit17e27776ea152509e1095bbf80f5af65bc7a7997 (patch)
tree054f71f588a617fd4f0af5ceaf2cc08d401c89b1 /src/main.rs
parent5aa264ca62efc17e3d55af616aa752c1d24573a2 (diff)
downloadraidgrep-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.rs2
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(())