Remove usages of gen identifier (#323)

`gen` is a reserved keyword in rust 2024, making it very awkward to use as a module/variable name.
This commit is contained in:
Graham Esau 2024-08-21 16:15:13 +01:00 committed by GitHub
parent 8142be1ea2
commit b4f214f6dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 186 additions and 171 deletions

View file

@ -1,4 +1,4 @@
use schemars::{gen::SchemaSettings, JsonSchema};
use schemars::{generate::SchemaSettings, JsonSchema};
#[derive(JsonSchema)]
pub struct MyStruct {
@ -18,7 +18,7 @@ fn main() {
s.option_nullable = true;
s.option_add_null_type = false;
});
let gen = settings.into_generator();
let schema = gen.into_root_schema_for::<MyStruct>();
let generator = settings.into_generator();
let schema = generator.into_root_schema_for::<MyStruct>();
println!("{}", serde_json::to_string_pretty(&schema).unwrap());
}