Skip to content

Commit

Permalink
Clean up some unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
juhaku committed Aug 11, 2024
1 parent 918bdb2 commit 67f04b3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions utoipa-gen/src/component/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ impl ToTokensDiagnostics for Schema<'_> {
self.data,
self.attributes,
ident,
self.generics,
None::<Vec<(TypeTree, &TypeTree)>>,
)?;

Expand All @@ -107,7 +106,6 @@ impl ToTokensDiagnostics for Schema<'_> {
self.data,
self.attributes,
ident,
self.generics,
alias_type_tree?
.children
.map(|children| children.into_iter().zip(schema_children)),
Expand Down Expand Up @@ -198,7 +196,6 @@ impl<'a> SchemaVariant<'a> {
data: &'a Data,
attributes: &'a [Attribute],
ident: &'a Ident,
generics: &'a Generics,
aliases: Option<I>,
) -> Result<SchemaVariant<'a>, Diagnostics> {
match data {
Expand Down Expand Up @@ -237,7 +234,6 @@ impl<'a> SchemaVariant<'a> {
rename_all: named_features.pop_rename_all_feature(),
features: named_features,
fields: named,
generics: Some(generics),
schema_as,
aliases: aliases.map(|aliases| aliases.into_iter().collect()),
}))
Expand Down Expand Up @@ -299,7 +295,6 @@ pub struct NamedStructSchema<'a> {
pub description: Option<Description>,
pub features: Option<Vec<Feature>>,
pub rename_all: Option<RenameAll>,
pub generics: Option<&'a Generics>,
pub aliases: Option<Vec<(TypeTree<'a>, &'a TypeTree<'a>)>>,
pub schema_as: Option<As>,
}
Expand Down Expand Up @@ -1106,7 +1101,6 @@ impl ComplexEnum<'_> {
rename_all: named_struct_features.pop_rename_all_feature(),
features: Some(named_struct_features),
fields: &named_fields.named,
generics: None,
aliases: None,
schema_as: None,
}),
Expand Down Expand Up @@ -1208,7 +1202,6 @@ impl ComplexEnum<'_> {
rename_all: named_struct_features.pop_rename_all_feature(),
features: Some(named_struct_features),
fields: &named_fields.named,
generics: None,
aliases: None,
schema_as: None,
}))
Expand Down Expand Up @@ -1276,7 +1269,6 @@ impl ComplexEnum<'_> {
rename_all: named_struct_features.pop_rename_all_feature(),
features: Some(named_struct_features),
fields: &named_fields.named,
generics: None,
aliases: None,
schema_as: None,
};
Expand Down Expand Up @@ -1437,7 +1429,6 @@ impl ComplexEnum<'_> {
rename_all: named_struct_features.pop_rename_all_feature(),
features: Some(named_struct_features),
fields: &named_fields.named,
generics: None,
aliases: None,
schema_as: None,
};
Expand Down
2 changes: 2 additions & 0 deletions utoipa-gen/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ fn find_option_type_tree<'t>(ty: &'t TypeTree) -> Option<&'t TypeTree<'t>> {
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct MacroPath {
pub path: String,
#[allow(unused)] // this is needed only if axum, actix or rocket
pub args: Vec<MacroArg>,
}

Expand Down Expand Up @@ -262,6 +263,7 @@ pub struct ArgValue {
pub struct ResolvedOperation {
pub path_operation: PathOperation,
pub path: String,
#[allow(unused)] // this is needed only if axum, actix or rocket
pub body: String,
}

Expand Down
2 changes: 0 additions & 2 deletions utoipa-gen/src/path/response/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ impl NamedStructResponse<'_> {
aliases: None,
description: None,
features: None,
generics: None,
rename_all: None,
struct_name: Cow::Owned(ident.to_string()),
schema_as: None,
Expand Down Expand Up @@ -435,7 +434,6 @@ impl<'p> ToResponseNamedStructResponse<'p> {
description: None,
fields,
features: None,
generics: None,
attributes,
struct_name: Cow::Owned(ident.to_string()),
rename_all: None,
Expand Down

0 comments on commit 67f04b3

Please sign in to comment.