Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usages of gen identifier #323

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Remove usages of gen identifier #323

merged 1 commit into from
Aug 21, 2024

Conversation

GREsau
Copy link
Owner

@GREsau GREsau commented Aug 21, 2024

Fixes #306

gen is a reserved keyword in rust 2024, making it very awkward to use as a module/variable name.

This PR renames the gen module to generate, and all gen variables/params to generator. gen is still available as a module for backward-compatibility, but is marked as deprecated with a suggestion to use the new module name instead.

In #306, I suggested making SchemaSettings available at the crate root (i.e. as schemars::SchemaSettings), but I've since changed my mind. More types may be added to the gen/generate module in the future (e.g. the "contract" proposal) - and I'm concerned that having to always put them at the crate root may make it very busy. Also, if schemars gets new features in the future (e.g. validating values against schemas), then these features may need their own settings, in which case having schemars::SchemaSettings apply only to schema generation would be confusing.

`gen` is a reserved keyword in rust 2024, making it very awkward to use as a module variable name.
@GREsau GREsau merged commit b4f214f into master Aug 21, 2024
8 checks passed
@GREsau GREsau deleted the gen branch August 21, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gen keyword is reserved in Rust 2024
1 participant