pub fn uniq_values<K, V>(maps: &[&HashMap<K, V>]) -> Vec<V>Expand description
Collects all unique values from one or more maps into a single vector.
Iterates over each map and collects all unique values into a single vector.
§Arguments
maps- A slice of references to maps to collect unique values from
§Returns
Vec<V>- A vector containing all unique values from the input maps
§Examples
use lowdash::uniq_values;
use std::collections::HashMap;
let mut map1 = HashMap::new();
map1.insert("a", 1);
map1.insert("b", 2);
let mut map2 = HashMap::new();
map2.insert("c", 2);
map2.insert("d", 3);
let result = uniq_values(&[&map1, &map2]);
assert_eq!(result.len(), 3);
assert!(result.contains(&1));
assert!(result.contains(&2));
assert!(result.contains(&3));