From f15f157c03615894a3db3e26802c3af234e5f071 Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 31 Oct 2019 22:07:53 -0700 Subject: [PATCH] make the structs public --- psopacket/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/psopacket/src/lib.rs b/psopacket/src/lib.rs index 4207dc6..49f2cd7 100644 --- a/psopacket/src/lib.rs +++ b/psopacket/src/lib.rs @@ -32,17 +32,17 @@ fn generate_struct_def(name: syn::Ident, attrs: &Vec) -> proc_macro2:: for attr in attrs { let element = match attr { AttrType::Value(ty, name, _) => { - quote!(#name: #ty) + quote!(pub #name: #ty) }, AttrType::Array(ty, name, len, _) => { - quote!(#name: [#ty; #len]) + quote!(pub #name: [#ty; #len]) } }; struct_def.push(element); } quote! { - struct #name { + pub struct #name { #(#struct_def),* } } @@ -78,7 +78,6 @@ fn generate_psopacket_impl(pkt_cmd: u16, name: syn::Ident, attrs: &Vec let mut tmp = Vec::new(); for _ in 0..flag { - //#name: <#ty as PSOPacketData>::from_bytes(&mut cur)?, tmp.push(<#vec_type as PSOPacketData>::from_bytes(&mut cur)?); } tmp