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

Function endpoint_path_specificity

crates/openshell-providers/src/profiles.rs:1513–1518  ·  view source on GitHub ↗
(path: &str)

Source from the content-addressed store, hash-verified

1511}
1512
1513fn 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
1520fn count_as_u32(count: usize) -> u32 {
1521 u32::try_from(count).unwrap_or(u32::MAX)

Callers 1

Calls 2

count_as_u32Function · 0.70
is_emptyMethod · 0.45

Tested by

no test coverage detected