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

Method rehash

publication/code/chapter06/hashmap.rs:64–66  ·  view source on GitHub ↗
(&self, pos: usize)

Source from the content-addressed store, hash-verified

62 }
63
64 fn rehash(&self, pos: usize) -> usize {
65 (pos + 1) % self.cap
66 }
67
68 fn insert(&mut self, key: usize, value: T) {
69 if 0 == key { panic!("Error: key must > 0"); }

Callers 3

insertMethod · 0.45
removeMethod · 0.45
get_posMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected