diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-04-24 10:36:49 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-04-24 10:36:49 -0400 |
commit | 6e95a6600679e6787a56ec5ef2a88fe0fbcf031f (patch) | |
tree | 4495e3a2bbb12b96b0b767ab1b844040c7cc4c71 /src/tab.rs | |
parent | e9a0d00d46ba4955f7d45d12aa412462e3daab39 (diff) |
add more error handling
- optimize/cleanup code
Diffstat (limited to 'src/tab.rs')
-rw-r--r-- | src/tab.rs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -38,11 +38,14 @@ impl JoshutoTab { Ok(tab) } - pub fn reload_contents(&mut self, sort_option: &sort::SortOption) { + pub fn reload_contents( + &mut self, + sort_option: &sort::SortOption, + ) -> Result<(), std::io::Error> { let mut list = self.curr_list.take(); if let Some(ref mut s) = list { if s.path.exists() { - s.update_contents(sort_option); + s.update_contents(sort_option)?; } }; self.curr_list = list; @@ -50,10 +53,11 @@ impl JoshutoTab { let mut list = self.parent_list.take(); if let Some(ref mut s) = list { if s.path.exists() { - s.update_contents(sort_option); + s.update_contents(sort_option)?; } }; self.parent_list = list; + Ok(()) } pub fn refresh( |