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

Method get_mut

publication/code/chapter06/hashmap.rs:170–173  ·  view source on GitHub ↗
(&mut self, key: usize)

Source from the content-addressed store, hash-verified

168 }
169
170 fn get_mut(&mut self, key: usize) -> Option<&mut T> {
171 let curr = self.get_pos(key);
172 self.data.get_mut(curr)
173 }
174
175 fn contains(&self, key: usize) -> bool {
176 if 0 == key { panic!("Error: key must > 0"); }

Callers 1

basicFunction · 0.45

Calls 1

get_posMethod · 0.80

Tested by

no test coverage detected