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

Function assert_not_empty

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

Asserts that the map behaves consistently as a non-empty map.

(map: &mut Map<N, M>, len: usize)

Source from the content-addressed store, hash-verified

229
230 /// Asserts that the map behaves consistently as a non-empty map.
231 fn assert_not_empty<const N: usize, const M: usize>(map: &mut Map<N, M>, len: usize) {
232 assert!(!map.is_empty());
233 assert_eq!(map.len(), len);
234
235 assert_eq!(map.iter().count(), len);
236 assert_eq!(map.keys().count(), len);
237 assert_eq!(map.values().count(), len);
238 }
239
240 /// Extends the map with entries and then clears it,
241 /// asserting correct behavior before and after.

Callers 2

extend_clearFunction · 0.85
insert_get_remove_innerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…