pub fn zig_ident(name: &str) -> StringExpand description
Convenience: always returns a usable Zig identifier.
Sanitizes the input so that it is a valid Zig identifier:
- Non-
[A-Za-z0-9_]characters are replaced with_(so serde renames likeog:imageorContent-Typebecomeog_image/Content_Type). - A leading digit is prefixed with
_. - The result is then checked against Zig’s reserved-word list and escaped
with a trailing
_if necessary.