Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::collections::HashSet;
- struct Test {
- data_hash_set: HashSet<String>,
- test_hash_set: HashSet<String>,
- }
- impl Test {
- fn new() -> Test {
- Test {
- data_hash_set: HashSet::new(),
- test_hash_set: HashSet::new(),
- }
- }
- }
- fn main() {
- let mut test = Test::new();
- test.data_hash_set.retain(|item| !test.test_hash_set.contains(item));
- }
Add Comment
Please, Sign In to add comment