From 86853985ca9ebdffe6ab01a3d26c265f6474b474 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Wed, 3 Dec 2025 15:32:39 -0800 Subject: [PATCH] implement `Update` for `OrderMap` and `OrderSet` --- Cargo.toml | 1 + src/update.rs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 9c419e339..62deac321 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ hashbrown = "0.15" hashlink = "0.10" indexmap = "2" intrusive-collections = "0.9.7" +ordermap = "1" parking_lot = "0.12" portable-atomic = "1" rustc-hash = "2" diff --git a/src/update.rs b/src/update.rs index d95bd13a9..65a10df07 100644 --- a/src/update.rs +++ b/src/update.rs @@ -340,6 +340,27 @@ where } } +unsafe impl Update for ordermap::OrderMap +where + K: Update + Eq + Hash, + V: Update, + S: BuildHasher, +{ + unsafe fn maybe_update(old_pointer: *mut Self, new_map: Self) -> bool { + maybe_update_map!(old_pointer, new_map) + } +} + +unsafe impl Update for ordermap::OrderSet +where + K: Update + Eq + Hash, + S: BuildHasher, +{ + unsafe fn maybe_update(old_pointer: *mut Self, new_set: Self) -> bool { + maybe_update_set!(old_pointer, new_set) + } +} + unsafe impl Update for BTreeMap where K: Update + Eq + Ord,