Minify error handling in Store::_update with try!()

This commit is contained in:
Matthias Beyer 2016-09-18 14:52:55 +02:00
parent b288e938f9
commit 07ff755ed7

View file

@ -502,12 +502,11 @@ impl Store {
/// This method assumes that entry is dropped _right after_ the call, hence /// This method assumes that entry is dropped _right after_ the call, hence
/// it is not public. /// it is not public.
fn _update<'a>(&'a self, entry: &mut FileLockEntry<'a>) -> Result<()> { 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) { let _ = try!(self.execute_hooks_for_mut_file(self.pre_update_aspects.clone(), entry)
return Err(e)
.map_err_into(SEK::PreHookExecuteError) .map_err_into(SEK::PreHookExecuteError)
.map_err_into(SEK::HookExecutionError) .map_err_into(SEK::HookExecutionError)
.map_err_into(SEK::UpdateCallError); .map_err_into(SEK::UpdateCallError)
} );
let mut hsmap = match self.entries.write() { let mut hsmap = match self.entries.write() {
Err(_) => return Err(SE::new(SEK::LockPoisoned, None)), Err(_) => return Err(SE::new(SEK::LockPoisoned, None)),