Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::collections::HashMap;
- fn main() {
- let mut map = HashMap::new();
- map.insert("key".to_string(), "one".to_string());
- let mut x = *(map.get(&"key".to_string()).unwrap().clone());
- x = "two".to_string();
- println!("{} {}", x, map.get(&"key".to_string()).unwrap());
- }
Add Comment
Please, Sign In to add comment