ch08
This commit is contained in:
parent
eb9773627e
commit
10b29ad9cb
14 changed files with 164 additions and 0 deletions
12
ch8/ch10/hash.rs
Normal file
12
ch8/ch10/hash.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
fn main() {
|
||||
let field_name = String::from("field");
|
||||
let field_value = String::from("value");
|
||||
|
||||
let mut map = HashMap::new();
|
||||
map.insert(field_name, &field_value);
|
||||
|
||||
print!("{}", map.get("field").unwrap());
|
||||
print!("{}", field_value);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue