Remove duplicated StoreId member in FileLockEntry, use member from Entry
This commit is contained in:
parent
ac89856e1c
commit
55e5255293
1 changed files with 4 additions and 6 deletions
|
@ -327,7 +327,7 @@ impl Store {
|
||||||
se
|
se
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut fle = FileLockEntry::new(self, Entry::new(id.clone()), id);
|
let mut fle = FileLockEntry::new(self, Entry::new(id));
|
||||||
self.execute_hooks_for_mut_file(self.post_create_aspects.clone(), &mut fle)
|
self.execute_hooks_for_mut_file(self.post_create_aspects.clone(), &mut fle)
|
||||||
.map_err(|e| SE::new(SEK::PostHookExecuteError, Some(Box::new(e))))
|
.map_err(|e| SE::new(SEK::PostHookExecuteError, Some(Box::new(e))))
|
||||||
.map(|_| fle)
|
.map(|_| fle)
|
||||||
|
@ -359,7 +359,7 @@ impl Store {
|
||||||
se.status = StoreEntryStatus::Borrowed;
|
se.status = StoreEntryStatus::Borrowed;
|
||||||
entry
|
entry
|
||||||
})
|
})
|
||||||
.map(|e| FileLockEntry::new(self, e, id))
|
.map(|e| FileLockEntry::new(self, e))
|
||||||
.and_then(|mut fle| {
|
.and_then(|mut fle| {
|
||||||
self.execute_hooks_for_mut_file(self.pre_retrieve_aspects.clone(), &mut fle)
|
self.execute_hooks_for_mut_file(self.pre_retrieve_aspects.clone(), &mut fle)
|
||||||
.map_err(|e| SE::new(SEK::HookExecutionError, Some(Box::new(e))))
|
.map_err(|e| SE::new(SEK::HookExecutionError, Some(Box::new(e))))
|
||||||
|
@ -469,7 +469,7 @@ impl Store {
|
||||||
Ok(e) => e,
|
Ok(e) => e,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut se = try!(hsmap.get_mut(&entry.key).ok_or(SE::new(SEK::IdNotFound, None)));
|
let mut se = try!(hsmap.get_mut(&entry.location).ok_or(SE::new(SEK::IdNotFound, None)));
|
||||||
|
|
||||||
assert!(se.is_borrowed(), "Tried to update a non borrowed entry.");
|
assert!(se.is_borrowed(), "Tried to update a non borrowed entry.");
|
||||||
|
|
||||||
|
@ -664,15 +664,13 @@ impl Drop for Store {
|
||||||
pub struct FileLockEntry<'a> {
|
pub struct FileLockEntry<'a> {
|
||||||
store: &'a Store,
|
store: &'a Store,
|
||||||
entry: Entry,
|
entry: Entry,
|
||||||
key: StoreId,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> FileLockEntry<'a, > {
|
impl<'a> FileLockEntry<'a, > {
|
||||||
fn new(store: &'a Store, entry: Entry, key: StoreId) -> FileLockEntry<'a> {
|
fn new(store: &'a Store, entry: Entry) -> FileLockEntry<'a> {
|
||||||
FileLockEntry {
|
FileLockEntry {
|
||||||
store: store,
|
store: store,
|
||||||
entry: entry,
|
entry: entry,
|
||||||
key: key,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue