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

Function put

publication/code/chapter10/cuckoofilter/src/lib.rs:112–119  ·  view source on GitHub ↗
(&mut self, fp: FingerPrint, i: usize)

Source from the content-addressed store, hash-verified

110 }
111
112 fn put(&mut self, fp: FingerPrint, i: usize) -> bool {
113 if self.buckets[i % self.len].insert(fp) {
114 self.len += 1;
115 true
116 } else {
117 false
118 }
119 }
120
121 fn delete<T: ?Sized + Hash>(&mut self, elem: &T) -> bool {
122 let FaI { fp, i1, i2 } = FaI::from_data::<_, H>(elem);

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected