fix field index in proc derive
This commit is contained in:
parent
9ff91eeffb
commit
2ee16d7994
@ -54,6 +54,7 @@ fn derive_unnamed(s: &synstructure::Structure, fields: &syn::FieldsUnnamed) -> T
|
||||
let mut parse_fields = quote!{};
|
||||
let mut serialize_fields = quote!{};
|
||||
for field in 0..fields.unnamed.len() {
|
||||
let field = syn::Index::from(field);
|
||||
parse_fields.extend(quote!{
|
||||
DnsPacketData::deserialize(_data)
|
||||
.with_context(|e| format!("failed parsing field {}::{}: {}", stringify!(#name), #field, e))?,
|
||||
|
@ -53,6 +53,7 @@ fn derive_unnamed(s: &synstructure::Structure, fields: &syn::FieldsUnnamed) -> T
|
||||
let mut parse_fields = quote!{};
|
||||
let mut format_fields = quote!{};
|
||||
for field in 0..fields.unnamed.len() {
|
||||
let field = syn::Index::from(field);
|
||||
parse_fields.extend(quote!{
|
||||
DnsTextData::dns_parse(_context, _data)
|
||||
.with_context(|e| format!("failed parsing field {}::{}: {}", stringify!(#name), #field, e))?,
|
||||
|
Loading…
Reference in New Issue
Block a user