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

Method rehash

code/chapter05/hashmap.rs:28–30  ·  view source on GitHub ↗
(&self, pos: usize)

Source from the content-addressed store, hash-verified

26 }
27
28 fn rehash(&self, pos: usize) -> usize {
29 (pos + 1) % self.size
30 }
31
32 fn insert(&mut self, key: usize, value: T) {
33 if 0 == key { panic!("Error: key must > 0"); }

Callers 3

insertMethod · 0.45
removeMethod · 0.45
getMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected