(first: &str, second: &str)
| 1522 | } |
| 1523 | |
| 1524 | fn host_patterns_can_overlap(first: &str, second: &str) -> bool { |
| 1525 | let first = first.to_ascii_lowercase(); |
| 1526 | let second = second.to_ascii_lowercase(); |
| 1527 | if !first.contains('*') { |
| 1528 | return host_pattern_matches(&second, &first); |
| 1529 | } |
| 1530 | if !second.contains('*') { |
| 1531 | return host_pattern_matches(&first, &second); |
| 1532 | } |
| 1533 | let first_labels: Vec<&str> = first.split('.').collect(); |
| 1534 | let second_labels: Vec<&str> = second.split('.').collect(); |
| 1535 | host_pattern_labels_can_overlap(&first_labels, &second_labels) |
| 1536 | } |
| 1537 | |
| 1538 | fn host_pattern_labels_can_overlap(first: &[&str], second: &[&str]) -> bool { |
| 1539 | match (first.split_first(), second.split_first()) { |
no test coverage detected