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

Method remove

publication/code/chapter10/lru.rs:83–88  ·  view source on GitHub ↗
(&mut self, key: &K)

Source from the content-addressed store, hash-verified

81 }
82
83 fn remove(&mut self, key: &K) -> Option<V> {
84 self.map.remove(&key).map(|index| {
85 self.remove_from_list(index);
86 self.entries[index].val.take().unwrap()
87 })
88 }
89
90 fn get(&mut self, key: &K) -> Option<&V> {
91 if self.contains(key) {

Callers 2

remove_tailMethod · 0.45
deleteFunction · 0.45

Calls 1

remove_from_listMethod · 0.45

Tested by

no test coverage detected