2 use crate::collections::HashMap;
5 fn no_lookup_host_duplicates() {
6 let mut addrs = HashMap::new();
7 let lh = match LookupHost::try_from(("localhost", 0)) {
9 Err(e) => panic!("couldn't resolve `localhost': {}", e),
12 *addrs.entry(sa).or_insert(0) += 1;
15 addrs.iter().filter(|&(_, &v)| v > 1).collect::<Vec<_>>(),
17 "There should be no duplicate localhost entries"