summaryrefslogtreecommitdiffstats
path: root/libimagstore
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-10-07 21:15:50 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-10-07 21:18:49 +0200
commit485d2802367338892ae4f774b7a39038ec0068b7 (patch)
tree726eb8246d3ac58d3658e83f32b33b2a42fa2f2d /libimagstore
parentc72291159e5da3bd0e19f294dd1fb79a6f17eff0 (diff)
Bugfix: The StoreEntry should know the _new_ StoreId
When moving a entry in the store, we also should tell the StoreEntry the new id.
Diffstat (limited to 'libimagstore')
-rw-r--r--libimagstore/src/store.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs
index 35e42d17..242fe10a 100644
--- a/libimagstore/src/store.rs
+++ b/libimagstore/src/store.rs
@@ -724,7 +724,10 @@ impl Store {
// Should therefor never fail
assert!(hsmap
.remove(&old_id)
- .and_then(|entry| hsmap.insert(new_id.clone(), entry)).is_none())
+ .and_then(|mut entry| {
+ entry.id = new_id.clone();
+ hsmap.insert(new_id.clone(), entry)
+ }).is_none())
}
}