Skip to navigation
Rust hashmap example
17.03.21
use std::collections::HashMap; fn main() { let mut state_codes: HashMap<&str, &str> = HashMap::new(); state_codes.insert("NV", "Nevada"); state_codes.insert("NY", "New York"); }
https://www.koderhq.com/tutorial/rust/hashmap/
Reply
Anonymous
nesed hasmap let mut cat: HashMap
> = HashMap::new(); let mut subcat: HashMap
= HashMap::new(); subcat.insert("Hello".to_string(), "Rust!".to_string()); cat.insert("Hello".to_string(), subcat);
17.03.21
Reply
Anonymous
Information Epoch 1732552907
Silence is golden.
Home
Notebook
Contact us