MCPcopy Create free account
hub / github.com/dcSpark/cddl-codegen / pick_generic_name

Function pick_generic_name

src/generation.rs:8492–8508  ·  view source on GitHub ↗

First name in a deterministic candidate sequence that does NOT collide with a defined type ident: `base` (`"W"`/`"R"`), then `base+suffix` (`"WSer"`/`"RDe"`), then `base+suffix+index` (`"WSer0"`, `"WSer1"`, …). The bare `base` wins whenever nothing is named it, so a spec with no `w`/`r` collision keeps the historical `"W"`/`"R"` names and the snapshot corpus does not churn.

(
    taken: &std::collections::BTreeSet<String>,
    base: &str,
    suffix: &str,
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

generateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected