MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / host_patterns_can_overlap

Function host_patterns_can_overlap

crates/openshell-server/src/grpc/provider.rs:737–749  ·  view source on GitHub ↗
(first: &str, second: &str)

Source from the content-addressed store, hash-verified

735}
736
737fn 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
751fn host_pattern_labels_can_overlap(first: &[&str], second: &[&str]) -> bool {
752 match (first.split_first(), second.split_first()) {

Calls 2

host_pattern_matchesFunction · 0.70

Tested by

no test coverage detected