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

Method hash

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

Source from the content-addressed store, hash-verified

58 }
59
60 fn hash(&self, key: usize) -> usize {
61 key % self.cap
62 }
63
64 fn rehash(&self, pos: usize) -> usize {
65 (pos + 1) % self.cap

Callers 6

insertMethod · 0.45
removeMethod · 0.45
get_posMethod · 0.45
hashFunction · 0.45
make_hashMethod · 0.45
get_hashMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected