Skip to content

Instantly share code, notes, and snippets.

@schmee
Last active August 29, 2015 14:01
Show Gist options
  • Save schmee/92d5f38e1005798d555c to your computer and use it in GitHub Desktop.
Save schmee/92d5f38e1005798d555c to your computer and use it in GitHub Desktop.
fn subtract(&mut self, mut other: &CountedSet<T>) {
for (key, count) in other.iter() {
// Data is a HashMap<T, uint>
match self.data.find_copy(key) {
Some(c) => { self.data.insert(*key, c - *count); }
_ => {}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment