Function collect_no_duplicates

Source
pub fn collect_no_duplicates<K, V>(
    i: impl Iterator<Item = (K, V)>,
) -> Result<HashMap<K, V>, K>
where K: Clone + Hash + Eq,
Expand description

Utility to build a HashMap of key value pairs from an iterator, returning an Err result if there are any duplicate keys in the iterator.