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

Method remove

crates/data-structures/src/small_map.rs:110–115  ·  view source on GitHub ↗
(&mut self, key: &K)

Source from the content-addressed store, hash-verified

108 }
109
110 pub fn remove(&mut self, key: &K) -> Option<V> {
111 match self {
112 Self::Small(list) => Self::key_pos(list, key).map(|idx| list.swap_remove(idx).1),
113 Self::Large(map) => map.remove(key),
114 }
115 }
116
117 /// Returns the position of `key` in `list`, if any.
118 fn key_pos(list: &[(K, V)], key: &K) -> Option<usize> {

Callers

nothing calls this directly

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected