diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-05-29 02:15:26 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-05-29 02:15:26 +0200 |
commit | ea5319812d4813627554e744267bdebdb7f8914c (patch) | |
tree | 772bf429acf502af1210278dca773e33dc953ed2 /libimagstore | |
parent | 9d37ffef919ba596d692d8e8a28d516de3ad107a (diff) | |
parent | 55e52552938b1ed31658142e7eb1553a560bdc86 (diff) |
Merge pull request #439 from matthiasbeyer/libimagstore/fle-and-entry-have-storeid
Remove duplicated StoreId member in FileLockEntry, use member from Entry
Diffstat (limited to 'libimagstore')
-rw-r--r-- | libimagstore/src/store.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs index 8af9519e..0bc3d444 100644 --- a/libimagstore/src/store.rs +++ b/libimagstore/src/store.rs @@ -338,7 +338,7 @@ impl Store { 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) .map_err(|e| SE::new(SEK::PostHookExecuteError, Some(Box::new(e)))) .map(|_| fle) @@ -370,7 +370,7 @@ impl Store { se.status = StoreEntryStatus::Borrowed; entry }) - .map(|e| FileLockEntry::new(self, e, id)) + .map(|e| FileLockEntry::new(self, e)) .and_then(|mut fle| { self.execute_hooks_for_mut_file(self.post_retrieve_aspects.clone(), &mut fle) .map_err(|e| SE::new(SEK::HookExecutionError, Some(Box::new(e)))) @@ -480,7 +480,7 @@ impl Store { 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."); @@ -683,15 +683,13 @@ impl Drop for Store { pub struct FileLockEntry<'a> { store: &'a Store, entry: Entry, - key: StoreId, } 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 { store: store, entry: entry, - key: key, } } } |