/// Return all http services on given hosts.
Return all http services on given hosts.
Return all http services on given hosts .
fn find_http_services(
    http_ports: &[(MacAddr, SocketAddr)],
    hosts: &[IpAddr]) -> Vec<Service> {
    let mut host_set = HashSet::<IpAddr>::new();
    let mut res      = Vec::new();
    host_set.extend(hosts);
    for &(ref mac, ref saddr) in http_ports {
        if host_set.contains(&saddr.ip()) {
            res.push(Service::HTTP(*mac, *saddr));
        }
    }
    res
}
fn find_http_services ( http_ports : & [ ( MacAddr , SocketAddr ) ] , hosts : & [ IpAddr ] ) -> Vec < Service > { let mut host_set = HashSet :: < IpAddr > :: new ( ) ; let mut res = Vec :: new ( ) ; host_set . extend ( hosts ) ; for & ( ref mac , ref saddr ) in http_ports { if host_set . contains ( & saddr . ip ( ) ) { res . push ( Service :: HTTP ( * mac , * saddr ) ) ; } } res }
Return all http services on given hosts.
Return all http services on given hosts .
http_ports
&[(MacAddr, SocketAddr)]
hosts
&[IpAddr]