Function hashmap_union::union_of [−][src]
pub fn union_of<K, V>(
one: &HashMap<K, V>,
two: &HashMap<K, V>,
f: fn(_: V, _: V) -> V
) -> HashMap<K, V> where
K: Hash + Eq + Clone,
V: Clone,
Merges two hashmaps, using f where the keys exist in both hashmaps
- one: The first hashmap
- two: The second hashmap
- f: What to do when the key exists in both hashmaps
- Returns: The union of one and two