Skip to content

Commit 11abd9c

Browse files
committed
prepare for 26.4.0
1 parent f0e7713 commit 11abd9c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/openapi.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct RealmMethodParameter {
7171
description: Option<String>,
7272
}
7373

74-
const RESERVED_WORDS: &[&str] = &["type", "self", "static", "use"];
74+
const RESERVED_WORDS: &[&str] = &["type", "self", "static", "use", "if"];
7575
const TAG_NONE: &str = "tag-none";
7676

7777
mod openapi {
@@ -981,7 +981,7 @@ mod openapi {
981981
}
982982

983983
impl ObjectSchema<Kind> {
984-
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<str> {
984+
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<'_, str> {
985985
match self {
986986
ObjectSchema::Struct(schema_struct) => schema_struct.to_rust_type(ref_mode),
987987
ObjectSchema::Map(schema_map) => schema_map.to_rust_type(ref_mode),
@@ -1131,7 +1131,7 @@ pub struct {name} {{
11311131
}
11321132

11331133
impl SchemaMap<Kind> {
1134-
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<str> {
1134+
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<'_, str> {
11351135
format!(
11361136
"TypeMap<String, {}>",
11371137
self.additional_properties.to_rust_type(ref_mode)
@@ -1147,7 +1147,7 @@ pub struct {name} {{
11471147
}
11481148

11491149
impl SchemaAllOf<Kind> {
1150-
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<str> {
1150+
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<'_, str> {
11511151
match &self.all_of.as_slice() {
11521152
&[property] => property.to_rust_type(ref_mode),
11531153
_ => todo!(),
@@ -1207,11 +1207,11 @@ pub enum {name} {{
12071207
}
12081208

12091209
impl Kind {
1210-
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<str> {
1210+
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<'_, str> {
12111211
self.to_rust_type_ref(ref_mode)
12121212
}
12131213

1214-
fn to_rust_parameter_type(&self, required: bool) -> Cow<str> {
1214+
fn to_rust_parameter_type(&self, required: bool) -> Cow<'_, str> {
12151215
let parameter_type = self.to_rust_type_ref(if required {
12161216
RefMode::Borrowed
12171217
} else {
@@ -1224,7 +1224,7 @@ pub enum {name} {{
12241224
}
12251225
}
12261226

1227-
fn to_rust_type_ref(&self, ref_mode: RefMode) -> Cow<str> {
1227+
fn to_rust_type_ref(&self, ref_mode: RefMode) -> Cow<'_, str> {
12281228
match self {
12291229
Kind::Generic(obj) => match obj {
12301230
Generic::Array {
@@ -1276,7 +1276,7 @@ pub enum {name} {{
12761276
}
12771277

12781278
impl Property {
1279-
fn to_rust_type_opt(&self, ref_mode: RefMode) -> Cow<str> {
1279+
fn to_rust_type_opt(&self, ref_mode: RefMode) -> Cow<'_, str> {
12801280
let rust_type = self.to_rust_type(ref_mode);
12811281
if self.required {
12821282
rust_type
@@ -1285,7 +1285,7 @@ pub enum {name} {{
12851285
}
12861286
}
12871287

1288-
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<str> {
1288+
fn to_rust_type(&self, ref_mode: RefMode) -> Cow<'_, str> {
12891289
self.kind.to_rust_type(ref_mode)
12901290
}
12911291
}

0 commit comments

Comments
 (0)