From 2c848ebaa59781462aba6da428c8dfcc51dbacf8 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 21 Apr 2022 15:25:46 +0000 Subject: Set carried item and update tags packets --- azalea-protocol/packet-macros/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'azalea-protocol/packet-macros/src') diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs index bdb83871..45df7e81 100644 --- a/azalea-protocol/packet-macros/src/lib.rs +++ b/azalea-protocol/packet-macros/src/lib.rs @@ -75,7 +75,7 @@ fn as_packet_derive(input: TokenStream, state: proc_macro2::TokenStream) -> Toke .collect::>(); let read_field_names = named.iter().map(|f| &f.ident).collect::>(); - let gen = quote! { + quote! { impl #ident { pub fn get(self) -> #state { #state::#ident(self) @@ -95,9 +95,8 @@ fn as_packet_derive(input: TokenStream, state: proc_macro2::TokenStream) -> Toke }.get()) } } - }; - - gen.into() + } + .into() } #[proc_macro_derive(GamePacket, attributes(varint))] -- cgit v1.2.3