Skip to content

Commit f773432

Browse files
committed
implement Update trait for IndexMap, and IndexSet
1 parent 99be5d9 commit f773432

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/update.rs

+31
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,37 @@ where
306306
}
307307
}
308308

309+
unsafe impl<K, S> Update for hashbrown::HashSet<K, S>
310+
where
311+
K: Update + Eq + Hash,
312+
S: BuildHasher,
313+
{
314+
unsafe fn maybe_update(old_pointer: *mut Self, new_set: Self) -> bool {
315+
maybe_update_set!(old_pointer, new_set)
316+
}
317+
}
318+
319+
unsafe impl<K, V, S> Update for indexmap::IndexMap<K, V, S>
320+
where
321+
K: Update + Eq + Hash,
322+
V: Update,
323+
S: BuildHasher,
324+
{
325+
unsafe fn maybe_update(old_pointer: *mut Self, new_map: Self) -> bool {
326+
maybe_update_map!(old_pointer, new_map)
327+
}
328+
}
329+
330+
unsafe impl<K, S> Update for indexmap::IndexSet<K, S>
331+
where
332+
K: Update + Eq + Hash,
333+
S: BuildHasher,
334+
{
335+
unsafe fn maybe_update(old_pointer: *mut Self, new_set: Self) -> bool {
336+
maybe_update_set!(old_pointer, new_set)
337+
}
338+
}
339+
309340
unsafe impl<K, V> Update for BTreeMap<K, V>
310341
where
311342
K: Update + Eq + Ord,

0 commit comments

Comments
 (0)