diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-13 12:42:53 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-13 12:42:53 -0500 |
commit | 2e5cdd07c2d8c18bad4099c82e36af64dc473a64 (patch) | |
tree | a9d7dee0f5a603cc96d6415a4549436a0f1818e0 /src/history.rs | |
parent | 468e607c5d1cd5d554ae356fd3c8e78425840347 (diff) |
code cleanup and fix path not showing when too long
Diffstat (limited to 'src/history.rs')
-rw-r--r-- | src/history.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/history.rs b/src/history.rs index fb425d4..b458f32 100644 --- a/src/history.rs +++ b/src/history.rs @@ -90,7 +90,7 @@ impl DirectoryHistory for JoshutoHistory { match self.entry(path.to_path_buf()) { Entry::Occupied(mut entry) => { let dirlist = entry.get_mut(); - if let Err(_) = dirlist.reload_contents(sort_option) { + if dirlist.reload_contents(sort_option).is_err() { entry.remove_entry(); } } @@ -105,7 +105,7 @@ 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(); - if let Err(_) = dirlist.reload_contents(sort_option) { + if dirlist.reload_contents(sort_option).is_err() { entry.remove_entry(); } } |