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

Function flat_param_matchers_to_def

crates/openshell-policy/src/lib.rs:446–453  ·  view source on GitHub ↗
(
    params: Vec<(String, QueryMatcherDef)>,
)

Source from the content-addressed store, hash-verified

444}
445
446fn flat_param_matchers_to_def(
447 params: Vec<(String, QueryMatcherDef)>,
448) -> BTreeMap<String, ParamMatcherDef> {
449 params
450 .into_iter()
451 .map(|(key, matcher)| (key, ParamMatcherDef::Matcher(matcher)))
452 .collect()
453}
454
455// Build one nested params path from a flat key. Collisions such as `a` and
456// `a.b` cannot round-trip as nested YAML, so callers fall back to the flat map.

Callers 1

flat_params_to_defFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected