MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / count

Method count

Source Code/19-30.rs:28–36  ·  view source on GitHub ↗
(&self, key: Self::Key)

Source from the content-addressed store, hash-verified

26 None
27 }
28 fn count(&self, key: Self::Key) -> Self::Count { //10
29 let mut c = 0;
30 for record in self.data.iter() {
31 if record.id == key {
32 c += 1;
33 }
34 }
35 c
36 }
37 }
38 fn get_name<D>(
39 dict: &D,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected