|
@ -92,11 +92,14 @@ fn generate_psopacket_impl(pkt_cmd: u16, name: syn::Ident, attrs: &Vec<AttrType> |
|
|
}
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
AttrType::Array(ty, name, len, _) => {
|
|
|
AttrType::Array(ty, name, len, _) => {
|
|
|
let array_init = (0..*len).map(|_k| quote! {
|
|
|
|
|
|
#ty::from_bytes(&mut cur)?,
|
|
|
|
|
|
});
|
|
|
|
|
|
quote! {
|
|
|
quote! {
|
|
|
#name: [#(#array_init)*],
|
|
|
|
|
|
|
|
|
#name: {
|
|
|
|
|
|
let mut arr = [#ty::default(); #len];
|
|
|
|
|
|
for e in arr.iter_mut() {
|
|
|
|
|
|
*e = #ty::from_bytes(&mut cur)?
|
|
|
|
|
|
}
|
|
|
|
|
|
arr
|
|
|
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|