From 485d2802367338892ae4f774b7a39038ec0068b7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 7 Oct 2016 21:15:50 +0200 Subject: [PATCH] Bugfix: The StoreEntry should know the _new_ StoreId When moving a entry in the store, we also should tell the StoreEntry the new id. --- libimagstore/src/store.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()) } }