use std::collections::HashMap; let mut map = HashMap::new(); map.insert("a", 1); // &str 可以作为键 map.insert("b", 2);