Guest User

Untitled

a guest
Jul 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. use std::collections::HashSet;
  2.  
  3. struct Test {
  4. data_hash_set: HashSet<String>,
  5. test_hash_set: HashSet<String>,
  6. }
  7.  
  8. impl Test {
  9. fn new() -> Test {
  10. Test {
  11. data_hash_set: HashSet::new(),
  12. test_hash_set: HashSet::new(),
  13. }
  14. }
  15. }
  16.  
  17. fn main() {
  18. let mut test = Test::new();
  19.  
  20. test.data_hash_set.retain(|item| !test.test_hash_set.contains(item));
  21. }
Add Comment
Please, Sign In to add comment