(first: &str, second: &str)
| 1561 | } |
| 1562 | |
| 1563 | fn path_patterns_can_overlap(first: &str, second: &str) -> bool { |
| 1564 | if path_matches_all(first) || path_matches_all(second) { |
| 1565 | return true; |
| 1566 | } |
| 1567 | if !first.contains('*') { |
| 1568 | return endpoint_path_matches(second, first); |
| 1569 | } |
| 1570 | if !second.contains('*') { |
| 1571 | return endpoint_path_matches(first, second); |
| 1572 | } |
| 1573 | match (path_prefix_pattern(first), path_prefix_pattern(second)) { |
| 1574 | (Some(first_prefix), Some(second_prefix)) => { |
| 1575 | first_prefix == second_prefix |
| 1576 | || first_prefix.starts_with(&format!("{second_prefix}/")) |
| 1577 | || second_prefix.starts_with(&format!("{first_prefix}/")) |
| 1578 | } |
| 1579 | _ => true, |
| 1580 | } |
| 1581 | } |
| 1582 | |
| 1583 | fn path_matches_all(path: &str) -> bool { |
| 1584 | path.is_empty() || path == "**" || path == "/**" |
no test coverage detected