(left: &NetworkEndpoint, right: &NetworkEndpoint)
| 605 | } |
| 606 | |
| 607 | fn endpoints_overlap(left: &NetworkEndpoint, right: &NetworkEndpoint) -> bool { |
| 608 | if !left.host.eq_ignore_ascii_case(&right.host) { |
| 609 | return false; |
| 610 | } |
| 611 | if left.path != right.path { |
| 612 | return false; |
| 613 | } |
| 614 | |
| 615 | let left_ports = canonical_ports(left); |
| 616 | let right_ports = canonical_ports(right); |
| 617 | left_ports.iter().any(|port| right_ports.contains(port)) |
| 618 | } |
| 619 | |
| 620 | fn canonical_ports(endpoint: &NetworkEndpoint) -> Vec<u32> { |
| 621 | if !endpoint.ports.is_empty() { |
no test coverage detected