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

Method remove_tail

publication/code/chapter10/lru.rs:162–172  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

160 }
161
162 fn remove_tail(&mut self) {
163 if let Some(index) = self.tail {
164 self.remove_from_list(index);
165 let key = &self.entries[index].key;
166 self.map.remove(key);
167 }
168
169 if self.tail.is_none() {
170 self.head = None;
171 }
172 }
173}
174
175fn main() {

Callers 1

ensure_roomMethod · 0.45

Calls 2

remove_from_listMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected