Edition 2024 prep: Escape r#gen and remove redundant ref (#11922)

Three edition 2021 compatible sets of changes in preparation for the
edition 2025 split out from #11724.

In edition 2025, `gen` is a keyword, so we escape it as `r#gen`. `ref`
and `ref mut` are not allowed anymore for `&T` and `&mut T`, so we
remove them. `cargo fmt` now formats inside of macros, which the 2021
formatter doesn't undo.
This commit is contained in:
konsti 2025-03-03 12:13:56 +01:00 committed by GitHub
parent 6fdcaa8a4b
commit d712ff243e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 63 additions and 44 deletions

View file

@ -42,7 +42,7 @@ impl schemars::JsonSchema for PythonVersion {
String::from("PythonVersion")
}
fn json_schema(_gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(_gen: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
schemars::schema::SchemaObject {
instance_type: Some(schemars::schema::InstanceType::String.into()),
string: Some(Box::new(schemars::schema::StringValidation {