use std::collections::HashMap; fn main() { let mut hash = HashMap::new(); hash.insert(\"Daniel\", \"798-1364\"); println!(\"{}\", hash); }
What you're looking for is the Debug formatter:
use std::collections::HashMap; fn main() { let mut hash = HashMap::new(); hash.insert("Daniel", "798-1364"); println!("{:?}", hash); }
This should print:
{"Daniel": "798-1364"}
See also: