(first: &str, second: &str)
| 735 | } |
| 736 | |
| 737 | fn host_patterns_can_overlap(first: &str, second: &str) -> bool { |
| 738 | let first = first.to_ascii_lowercase(); |
| 739 | let second = second.to_ascii_lowercase(); |
| 740 | if !first.contains('*') { |
| 741 | return host_pattern_matches(&second, &first); |
| 742 | } |
| 743 | if !second.contains('*') { |
| 744 | return host_pattern_matches(&first, &second); |
| 745 | } |
| 746 | let first_labels: Vec<&str> = first.split('.').collect(); |
| 747 | let second_labels: Vec<&str> = second.split('.').collect(); |
| 748 | host_pattern_labels_can_overlap(&first_labels, &second_labels) |
| 749 | } |
| 750 | |
| 751 | fn host_pattern_labels_can_overlap(first: &[&str], second: &[&str]) -> bool { |
| 752 | match (first.split_first(), second.split_first()) { |
no test coverage detected