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:
parent
8142be1ea2
commit
b4f214f6dc
42 changed files with 186 additions and 171 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue