MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / remove

Method remove

code/chapter09/lru.rs:67–72  ·  view source on GitHub ↗
(&mut self, key: &K)

Source from the content-addressed store, hash-verified

65 }
66
67 fn remove(&mut self, key: &K) -> Option<V> {
68 self.map.remove(&key).map(|index| {
69 self.remove_from_list(index);
70 self.entries[index].val.take().unwrap()
71 })
72 }
73
74 fn get(&mut self, key: &K) -> Option<&V> {
75 if self.contains(key) { self.access(key); }

Callers 4

remove_tailMethod · 0.45
deleteFunction · 0.45
remove_vertexMethod · 0.45
bfsFunction · 0.45

Calls 1

remove_from_listMethod · 0.45

Tested by

no test coverage detected