mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-05-09 08:00:41 +00:00
more error messages
[skip ci]
This commit is contained in:
parent
a57f1c097d
commit
2a35e044db
9 changed files with 62 additions and 2 deletions
|
@ -35,7 +35,12 @@ fn parse_named_fields(named_fields: &FieldsNamed) -> syn::Result<ParseData> {
|
|||
pub(super) fn parse_struct(strukt: &DataStruct) -> syn::Result<ParseData> {
|
||||
match &strukt.fields {
|
||||
Fields::Named(named_fields) => parse_named_fields(named_fields),
|
||||
Fields::Unnamed(_) => unimplemented!(),
|
||||
Fields::Unnamed(unnamed_fields) => {
|
||||
return Err(syn::Error::new(
|
||||
unnamed_fields.span(),
|
||||
"#[derive(OpenapiType)] does not support tuple structs"
|
||||
))
|
||||
},
|
||||
Fields::Unit => Ok(ParseData::Unit)
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +55,12 @@ pub(super) fn parse_enum(inum: &DataEnum, attrs: &ContainerAttributes) -> syn::R
|
|||
Fields::Named(named_fields) => {
|
||||
types.push((name, parse_named_fields(named_fields)?));
|
||||
},
|
||||
Fields::Unnamed(_unnamed_fields) => unimplemented!(),
|
||||
Fields::Unnamed(unnamed_fields) => {
|
||||
return Err(syn::Error::new(
|
||||
unnamed_fields.span(),
|
||||
"#[derive(OpenapiType)] does not support tuple variants"
|
||||
))
|
||||
},
|
||||
Fields::Unit => strings.push(name)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue