(endpoint: &mut NetworkEndpoint)
| 804 | } |
| 805 | |
| 806 | fn normalize_endpoint(endpoint: &mut NetworkEndpoint) { |
| 807 | let mut ports = canonical_ports(endpoint); |
| 808 | ports.sort_unstable(); |
| 809 | ports.dedup(); |
| 810 | endpoint.port = ports.first().copied().unwrap_or(0); |
| 811 | endpoint.ports = ports; |
| 812 | dedup_strings(&mut endpoint.allowed_ips); |
| 813 | dedup_l7_rules(&mut endpoint.rules); |
| 814 | dedup_deny_rules(&mut endpoint.deny_rules); |
| 815 | } |
| 816 | |
| 817 | fn dedup_strings(values: &mut Vec<String>) { |
| 818 | let mut seen = HashSet::new(); |
no test coverage detected