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