Last active
August 29, 2015 14:01
-
-
Save schmee/92d5f38e1005798d555c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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