From c51a7ee50049973abd33a3e95b79d8d1bb35688a Mon Sep 17 00:00:00 2001 From: Konstantinos Demartinos Date: Tue, 5 Mar 2024 17:33:25 +0200 Subject: [PATCH] fix(sui-move-natives): replace deprecated method `indexmap::IndexSet::remove` is replaced by `indexmap::IndexSet::swap_remove` --- .../latest/sui-move-natives/src/object_runtime/mod.rs | 4 ++-- sui-execution/latest/sui-move-natives/src/test_scenario.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sui-execution/latest/sui-move-natives/src/object_runtime/mod.rs b/sui-execution/latest/sui-move-natives/src/object_runtime/mod.rs index 291d23aedd3..95b66d46867 100644 --- a/sui-execution/latest/sui-move-natives/src/object_runtime/mod.rs +++ b/sui-execution/latest/sui-move-natives/src/object_runtime/mod.rs @@ -199,7 +199,7 @@ impl<'a> ObjectRuntime<'a> { // remove from deleted_ids for the case in dynamic fields where the Field object was deleted // and then re-added in a single transaction. In that case, we also skip adding it // to new_ids. - let was_present = self.state.deleted_ids.remove(&id); + let was_present = self.state.deleted_ids.swap_remove(&id); if !was_present { // mark the id as new self.state.new_ids.insert(id); @@ -227,7 +227,7 @@ impl<'a> ObjectRuntime<'a> { )); }; - let was_new = self.state.new_ids.remove(&id); + let was_new = self.state.new_ids.swap_remove(&id); if !was_new { self.state.deleted_ids.insert(id); } diff --git a/sui-execution/latest/sui-move-natives/src/test_scenario.rs b/sui-execution/latest/sui-move-natives/src/test_scenario.rs index d61011f9e2e..d78ca0aca77 100644 --- a/sui-execution/latest/sui-move-natives/src/test_scenario.rs +++ b/sui-execution/latest/sui-move-natives/src/test_scenario.rs @@ -100,14 +100,14 @@ pub fn end_transaction( { for addr_inventory in inventories.address_inventories.values_mut() { for s in addr_inventory.values_mut() { - s.remove(id); + s.swap_remove(id); } } for s in &mut inventories.shared_inventory.values_mut() { - s.remove(id); + s.swap_remove(id); } for s in &mut inventories.immutable_inventory.values_mut() { - s.remove(id); + s.swap_remove(id); } inventories.taken.remove(id); }