Guest User

Untitled

a guest
Dec 15th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. use std::collections::HashMap;
  2.  
  3. fn main() {
  4. let mut map = HashMap::new();
  5. map.insert("key".to_string(), "one".to_string());
  6.  
  7. let mut x = *(map.get(&"key".to_string()).unwrap().clone());
  8.  
  9. x = "two".to_string();
  10. println!("{} {}", x, map.get(&"key".to_string()).unwrap());
  11. }
Add Comment
Please, Sign In to add comment