MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / extend_clear

Function extend_clear

crates/data-structures/src/small_map.rs:242–248  ·  view source on GitHub ↗

Extends the map with entries and then clears it, asserting correct behavior before and after.

(map: &mut Map<N, M>, entries: &HashSet<(K, V)>)

Source from the content-addressed store, hash-verified

240 /// Extends the map with entries and then clears it,
241 /// asserting correct behavior before and after.
242 fn extend_clear<const N: usize, const M: usize>(map: &mut Map<N, M>, entries: &HashSet<(K, V)>) {
243 map.extend(entries.iter().cloned());
244 assert_not_empty(map, entries.len());
245
246 map.clear();
247 assert_empty(map, &0, 0);
248 }
249
250 /// Asserts that the map contains `key` with value `val`.
251 fn assert_key_eq<const N: usize, const M: usize>(map: &mut Map<N, M>, key: K, mut val: V) {

Callers

nothing calls this directly

Calls 6

assert_not_emptyFunction · 0.85
assert_emptyFunction · 0.85
iterMethod · 0.65
clearMethod · 0.65
extendMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…