Remove unwrap() by matching, remove unneeded deref()
This commit is contained in:
parent
a481200c9a
commit
8d9bd5154d
1 changed files with 7 additions and 9 deletions
|
@ -512,15 +512,13 @@ impl Store {
|
||||||
id: &StoreId)
|
id: &StoreId)
|
||||||
-> Result<()>
|
-> Result<()>
|
||||||
{
|
{
|
||||||
let guard = aspects.deref().lock();
|
match aspects.lock() {
|
||||||
if guard.is_err() { return Err(SE::new(SEK::PreHookExecuteError, None)) }
|
Err(_) => return Err(SE::new(SEK::PreHookExecuteError, None)),
|
||||||
|
Ok(g) => g
|
||||||
guard.unwrap().deref().iter()
|
}.iter().fold(Ok(()), |acc, aspect| {
|
||||||
.fold(Ok(()), |acc, aspect| {
|
debug!("[Aspect][exec]: {:?}", aspect);
|
||||||
debug!("[Aspect][exec]: {:?}", aspect);
|
acc.and_then(|_| (aspect as &StoreIdAccessor).access(id))
|
||||||
acc.and_then(|_| (aspect as &StoreIdAccessor).access(id))
|
}).map_err(|e| SE::new(SEK::PreHookExecuteError, Some(Box::new(e))))
|
||||||
})
|
|
||||||
.map_err(|e| SE::new(SEK::PreHookExecuteError, Some(Box::new(e))))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute_hooks_for_mut_file(&self,
|
fn execute_hooks_for_mut_file(&self,
|
||||||
|
|
Loading…
Reference in a new issue