@@ -28,7 +28,6 @@ use heck::ToUpperCamelCase;
2828use proc_macro:: TokenStream ;
2929use quote:: quote;
3030use syn:: punctuated:: Punctuated ;
31- use syn:: spanned:: Spanned ;
3231use syn:: { parse_macro_input, Data , DataStruct , DeriveInput , Meta , Token } ;
3332
3433/// Generates a delegating `NetworkBehaviour` implementation for the struct this is used for. See
@@ -61,7 +60,6 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> syn::Result<Toke
6160 let BehaviourAttributes {
6261 prelude_path,
6362 user_specified_out_event,
64- deprecation_tokenstream,
6563 } = parse_attributes ( ast) ?;
6664
6765 let multiaddr = quote ! { #prelude_path:: Multiaddr } ;
@@ -756,8 +754,6 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> syn::Result<Toke
756754
757755 // Now the magic happens.
758756 let final_quote = quote ! {
759- #deprecation_tokenstream
760-
761757 #out_event_definition
762758
763759 impl #impl_generics #trait_to_impl for #name #ty_generics
@@ -881,15 +877,13 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> syn::Result<Toke
881877struct BehaviourAttributes {
882878 prelude_path : syn:: Path ,
883879 user_specified_out_event : Option < syn:: Type > ,
884- deprecation_tokenstream : proc_macro2:: TokenStream ,
885880}
886881
887882/// Parses the `value` of a key=value pair in the `#[behaviour]` attribute into the requested type.
888883fn parse_attributes ( ast : & DeriveInput ) -> syn:: Result < BehaviourAttributes > {
889884 let mut attributes = BehaviourAttributes {
890885 prelude_path : syn:: parse_quote! { :: libp2p:: swarm:: derive_prelude } ,
891886 user_specified_out_event : None ,
892- deprecation_tokenstream : proc_macro2:: TokenStream :: new ( ) ,
893887 } ;
894888
895889 for attr in ast
@@ -909,16 +903,6 @@ fn parse_attributes(ast: &DeriveInput) -> syn::Result<BehaviourAttributes> {
909903 }
910904
911905 if meta. path ( ) . is_ident ( "to_swarm" ) || meta. path ( ) . is_ident ( "out_event" ) {
912- if meta. path ( ) . is_ident ( "out_event" ) {
913- let warning = proc_macro_warning:: FormattedWarning :: new_deprecated (
914- "out_event_renamed_to_to_swarm" ,
915- "The `out_event` attribute has been renamed to `to_swarm`." ,
916- meta. span ( ) ,
917- ) ;
918-
919- attributes. deprecation_tokenstream = quote:: quote! { #warning } ;
920- }
921-
922906 let value = meta. require_name_value ( ) ?. value . require_str_lit ( ) ?;
923907
924908 attributes. user_specified_out_event = Some ( syn:: parse_str ( & value) ?) ;
0 commit comments