Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. use std::collections::HashMap;
  2. use std::sync::Arc;
  3.  
  4. #[derive(PartialEq, Eq, Hash, Debug)]
  5. struct V {}
  6.  
  7. fn main() {
  8. let v1 = V {};
  9. let v2 = V {};
  10.  
  11. let mut collect = HashMap::<&V, usize>::new();
  12.  
  13. collect.insert(&v1, 15);
  14. collect.insert(&v2, 42);
  15.  
  16. println!("{:?}", collect.get(&v1));
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement