libninja
libninja copied to clipboard
fix(keywords): extend the list of restricted names, with a test
I observed that the list of restricted words didn't cover some attractive words when I attempted to generate a Rust client for a schema that used keywords like async as field names.
- Extended the list of names in
is_restricted(). - Added a short yaml schema that uses all of the restricted words as field names. Put this fixture to work in a test, to ensure no regressions.
The list is undoubtedly incomplete, but there is a very clear place to add new ones (thank you!) and now a test to validate it.
The whitespace changes in lib.rs are from my editor auto-applying cargo fmt to the file.