If InputObject contains an unnamed field, the correct error message will be given. #498
This commit is contained in:
parent
37d77f653b
commit
bbf9b9bfb2
@ -26,7 +26,10 @@ pub fn generate(object_args: &args::InputObject) -> GeneratorResult<TokenStream>
|
|||||||
for field in &s.fields {
|
for field in &s.fields {
|
||||||
let vis = &field.vis;
|
let vis = &field.vis;
|
||||||
let ty = &field.ty;
|
let ty = &field.ty;
|
||||||
let ident = &field.ident;
|
let ident = match &field.ident {
|
||||||
|
Some(ident) => ident,
|
||||||
|
None => return Err(Error::new_spanned(&ident, "All fields must be named.").into()),
|
||||||
|
};
|
||||||
let attrs = field
|
let attrs = field
|
||||||
.attrs
|
.attrs
|
||||||
.iter()
|
.iter()
|
||||||
|
Loading…
Reference in New Issue
Block a user