summaryrefslogtreecommitdiffstats
path: root/src/history.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-08-29 22:06:19 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-08-29 22:08:23 -0400
commit5be4a5f472655a76e1430bad09a19f6ad111e474 (patch)
tree1fcffa6c8d37cc6d538b29b6fbd773e8de58512d /src/history.rs
parent4f3842b56f1729dcd8e81c77f98253ed9dfb23b3 (diff)
big rework and dependency update
- abstract JoshutoContext implementation behind functions - rework io workers in an attempt to fix a bug - update dependencies - remove JoshutoContextWorker
Diffstat (limited to 'src/history.rs')
-rw-r--r--src/history.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/history.rs b/src/history.rs
index 60d9641..fb425d4 100644
--- a/src/history.rs
+++ b/src/history.rs
@@ -90,7 +90,9 @@ impl DirectoryHistory for JoshutoHistory {
match self.entry(path.to_path_buf()) {
Entry::Occupied(mut entry) => {
let dirlist = entry.get_mut();
- dirlist.reload_contents(sort_option)?;
+ if let Err(_) = dirlist.reload_contents(sort_option) {
+ entry.remove_entry();
+ }
}
Entry::Vacant(entry) => {
let dirlist = JoshutoDirList::new(path.to_path_buf(), sort_option)?;
@@ -103,7 +105,9 @@ impl DirectoryHistory for JoshutoHistory {
fn reload(&mut self, path: &Path, sort_option: &sort::SortOption) -> std::io::Result<()> {
if let Entry::Occupied(mut entry) = self.entry(path.to_path_buf()) {
let dirlist = entry.get_mut();
- dirlist.reload_contents(sort_option)?;
+ if let Err(_) = dirlist.reload_contents(sort_option) {
+ entry.remove_entry();
+ }
}
Ok(())
}