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

Method get

Source Code/19-28.rs:15–22  ·  view source on GitHub ↗
(&self, key: u32)

Source from the content-addressed store, hash-verified

13 }
14 impl Dictionary<u32> for RecordSet {
15 fn get(&self, key: u32) -> Option<String> {
16 for record in self.data.iter() {
17 if record.id == key {
18 return Some(String::from(&record.name));
19 }
20 }
21 None
22 }
23 }
24 fn get_name<D>(dict: &D, id: u32) -> Option<String>
25 where

Callers 1

get_nameFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected