diff --git a/MIGRATING.md b/MIGRATING.md index b625219fe..ea5b67c8d 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -49,12 +49,12 @@ pub fn migrate(deps: DepsMut, _env: Env, _msg: Empty) -> Result::from(*k)); + signed_int_map.remove(deps.storage, (*k).into()); } // Save in new format - for (k, v) in current.iter() { - signed_int_map_new.save(deps.storage, *k, v)?; + for (k, v) in current.into_iter() { + signed_int_map_new.save(deps.storage, k, &v)?; } // Confirm old map is empty diff --git a/packages/storage-plus/src/map.rs b/packages/storage-plus/src/map.rs index a04015465..94d78bdcd 100644 --- a/packages/storage-plus/src/map.rs +++ b/packages/storage-plus/src/map.rs @@ -685,19 +685,18 @@ mod test { // remove old entries for (k, _) in current.iter() { - SIGNED_ID_OLD.remove(&mut store, IntKeyOld::::from(*k)); + SIGNED_ID_OLD.remove(&mut store, (*k).into()); } // confirm map is empty assert!(SIGNED_ID_OLD .range(&store, None, None, Order::Ascending) - .collect::>>() - .unwrap() - .is_empty()); + .next() + .is_none()); // save in new format - for (k, v) in current.iter() { - SIGNED_ID.save(&mut store, *k, v).unwrap(); + for (k, v) in current.into_iter() { + SIGNED_ID.save(&mut store, k, &v).unwrap(); } // obtain new keys