Skip to main content

Module normalize

Module normalize 

Source
Expand description

normalize.rs: one spelling rule for every identifier tocat matches.

Schemes, endpoint options, plugin names, plugin option keys and enum values are all matched the same way: case is ignored and dashes and underscores are noise. max-connections, max_connections and MaxConnections are one option, and a user who guesses wrong about a convention is right anyway.

The rule is matching only. A normalized string is never stored, forwarded or displayed: canonical answers which declared spelling was meant, and the caller then uses that declared spelling. Free-form values (paths, labels, instance aliases, commands) never come near this module.

Functionsยง

canonical
Which of declared the user meant by candidate, if exactly one.
normalize
Normalize an identifier to a consistent form: lowercase, with no dashes or underscores.