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

Function host_patterns_can_overlap

crates/openshell-providers/src/profiles.rs:1524–1536  ·  view source on GitHub ↗
(first: &str, second: &str)

Source from the content-addressed store, hash-verified

1522}
1523
1524fn 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
1538fn host_pattern_labels_can_overlap(first: &[&str], second: &[&str]) -> bool {
1539 match (first.split_first(), second.split_first()) {

Calls 2

host_pattern_matchesFunction · 0.70

Tested by

no test coverage detected