Skip to main content

fuzzy_response_match

Function fuzzy_response_match 

Source
pub fn fuzzy_response_match<'a>(
    method: &str,
    all_def_names: impl Iterator<Item = &'a str>,
) -> Result<Option<String>>
Expand description

Finds a *Response definition whose name’s tokens are a superset of the method’s tokens, preferring the shortest match. Bails if two or more candidates tie for shortest - an unresolvable ambiguity, not something to silently guess at (a future codex schema change that introduces a second plausible *Response name for some method should break the build, not silently wire that method to whichever candidate happened to sort first). A single strictly-shortest candidate is treated as an unambiguous match even when longer candidates also exist.