summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch08-common-collections/listing-08-22/src/main.rs
blob: 2b2a73f94a7ff502401387d5432b21f1ad067cd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
}