Remove iflet by using Option::{map_err, and}()

This commit is contained in:
Matthias Beyer 2016-05-14 19:05:32 +02:00
parent 3fb6d507e5
commit a852da54dd

View file

@ -341,12 +341,9 @@ impl Store {
}) })
.map(|e| FileLockEntry::new(self, e, id)) .map(|e| FileLockEntry::new(self, e, id))
.and_then(|mut fle| { .and_then(|mut fle| {
if let Err(e) = self.execute_hooks_for_mut_file(self.post_retrieve_aspects.clone(), &mut fle) { self.execute_hooks_for_mut_file(self.pre_retrieve_aspects.clone(), &mut fle)
Err(StoreError::new(StoreErrorKind::HookExecutionError, Some(Box::new(e)))) .map_err(|e| StoreError::new(StoreErrorKind::HookExecutionError, Some(Box::new(e))))
} else { .and(Ok(fle))
Ok(fle)
}
}) })
} }