diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-14 10:34:14 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-14 10:34:14 -0400 |
commit | 032258fcd42761719561a43e52c1a264b92cf067 (patch) | |
tree | ddadf6c31989b08c69ec2fc6b738399bf00eb597 /src/history.rs | |
parent | 18ddb386325e9a017df45825ace6d667c90ac3e5 (diff) |
make sure to reload src and dest dirlists after a io operation completes
Diffstat (limited to 'src/history.rs')
-rw-r--r-- | src/history.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/history.rs b/src/history.rs index cf6892f..16fc8a3 100644 --- a/src/history.rs +++ b/src/history.rs @@ -16,6 +16,8 @@ pub trait DirectoryHistory { sort_option: &sort::SortOption, ) -> std::io::Result<()>; fn depreciate_all_entries(&mut self); + + fn depreciate_entry(&mut self, path: &Path); } pub type JoshutoHistory = HashMap<PathBuf, JoshutoDirList>; @@ -75,6 +77,10 @@ impl DirectoryHistory for JoshutoHistory { fn depreciate_all_entries(&mut self) { self.iter_mut().for_each(|(_, v)| v.depreciate()); } + + fn depreciate_entry(&mut self, path: &Path) { + self.get_mut(path).map(|v| v.depreciate()); + } } fn get_index_of_value(arr: &[JoshutoDirEntry], val: &Path) -> Option<usize> { |