Skip to main content

validate_relation_format

Function validate_relation_format 

Source
pub fn validate_relation_format(s: &str) -> Result<(), String>
Expand description

Validates that a NORMALIZED relation matches ^[a-z][a-z0-9-]*$.

v1.2.8: hyphen replaced underscore here together with normalize_relation. The pair must agree, and before they did this function rejected the very spelling the crate was persisting: applies-to failed validation while 50 346 rows of it sat in one database, because the write path that produced them called neither this nor the normaliser.

Takes the normalised form. Callers that hold raw input run it through normalize_relation or parse_relation first.