From 07ff755ed79fe8193fde52390406ec00c0577526 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 18 Sep 2016 14:52:55 +0200 Subject: [PATCH] Minify error handling in Store::_update with try!() --- libimagstore/src/store.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index bdda753e..f2d0af99 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -502,12 +502,11 @@ impl Store { /// This method assumes that entry is dropped _right after_ the call, hence /// it is not public. fn _update<'a>(&'a self, entry: &mut FileLockEntry<'a>) -> Result<()> { - if let Err(e) = self.execute_hooks_for_mut_file(self.pre_update_aspects.clone(), entry) { - return Err(e) - .map_err_into(SEK::PreHookExecuteError) - .map_err_into(SEK::HookExecutionError) - .map_err_into(SEK::UpdateCallError); - } + let _ = try!(self.execute_hooks_for_mut_file(self.pre_update_aspects.clone(), entry) + .map_err_into(SEK::PreHookExecuteError) + .map_err_into(SEK::HookExecutionError) + .map_err_into(SEK::UpdateCallError) + ); let mut hsmap = match self.entries.write() { Err(_) => return Err(SE::new(SEK::LockPoisoned, None)),