diff options
author | Kamiyaa <jeff.no.zhao@gmail.com> | 2020-06-06 15:00:15 -0400 |
---|---|---|
committer | Kamiyaa <jeff.no.zhao@gmail.com> | 2020-06-06 15:00:15 -0400 |
commit | 4f3842b56f1729dcd8e81c77f98253ed9dfb23b3 (patch) | |
tree | a9cb1b5c300fcbdbcdfad34f0076919e30f03c88 /src/history.rs | |
parent | a462ebe2140323a6085ce5a064727288fa4dff3c (diff) |
shell command now parses correctly
- rework file operations
- simpler model for listening on io_worker progress
- cargo fmt/clippy
Diffstat (limited to 'src/history.rs')
-rw-r--r-- | src/history.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/history.rs b/src/history.rs index edb1a95..60d9641 100644 --- a/src/history.rs +++ b/src/history.rs @@ -101,12 +101,9 @@ impl DirectoryHistory for JoshutoHistory { } fn reload(&mut self, path: &Path, sort_option: &sort::SortOption) -> std::io::Result<()> { - match self.entry(path.to_path_buf()) { - Entry::Occupied(mut entry) => { - let dirlist = entry.get_mut(); - dirlist.reload_contents(sort_option)?; - } - _ => {} + if let Entry::Occupied(mut entry) = self.entry(path.to_path_buf()) { + let dirlist = entry.get_mut(); + dirlist.reload_contents(sort_option)?; } Ok(()) } @@ -116,7 +113,9 @@ impl DirectoryHistory for JoshutoHistory { } fn depreciate_entry(&mut self, path: &Path) { - self.get_mut(path).map(|v| v.depreciate()); + if let Some(v) = self.get_mut(path) { + v.depreciate(); + } } } |