Function nexsys_core::split_hm
source · Expand description
Returns a tuple of Vecs that contain the keys and values of the original HashMap.
The index of the key will be the same as its corresponding value’s index.
Example
use std::collections::HashMap;
use nexsys_core::split_hm;
let my_map = HashMap::from([
("a", 1),
("b", 2),
("c", 3)
]);
let vecs = split_hm(my_map.clone());
assert_eq!(my_map[vecs.0[0]], vecs.1[0])