(path: &str)
| 1511 | } |
| 1512 | |
| 1513 | fn endpoint_path_specificity(path: &str) -> u32 { |
| 1514 | if path.is_empty() || path == "**" { |
| 1515 | return 0; |
| 1516 | } |
| 1517 | 1_000_000u32.saturating_add(count_as_u32(path.chars().filter(|ch| *ch != '*').count())) |
| 1518 | } |
| 1519 | |
| 1520 | fn count_as_u32(count: usize) -> u32 { |
| 1521 | u32::try_from(count).unwrap_or(u32::MAX) |
no test coverage detected