SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::collections::HashMap;
  2.  
  3. fn main() {
  4.     let mut map = HashMap::new();
  5.  
  6.     map.insert("a", 1);
  7.     map.insert("b", 2);
  8.     map.insert("c", 3);
  9.  
  10.     for val in map.values_mut() {
  11.         *val += 10;
  12.     }
  13.  
  14.     for (key, val) in map {
  15.         println!("{} {}", key, val);
  16.     }
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top