mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
387 B
14 lines
387 B
3 years ago
|
fn main() {
|
||
|
// ANCHOR: here
|
||
|
use std::collections::HashMap;
|
||
|
|
||
|
let field_name = String::from("Favorite color");
|
||
|
let field_value = String::from("Blue");
|
||
|
|
||
|
let mut map = HashMap::new();
|
||
|
map.insert(field_name, field_value);
|
||
|
// field_name and field_value are invalid at this point, try using them and
|
||
|
// see what compiler error you get!
|
||
|
// ANCHOR_END: here
|
||
|
}
|