mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 01:57:45 +08:00 
			
		
		
		
	refactor(macros): use syn2.0 (#2890)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
		| @ -1,3 +1,5 @@ | ||||
| use proc_macro2::TokenStream; | ||||
| use quote::ToTokens; | ||||
| use syn::{ | ||||
|     parse::Parse, spanned::Spanned, DeriveInput, Field, Fields, LitStr, Token, TypePath, Variant, | ||||
| }; | ||||
| @ -38,10 +40,10 @@ impl Parse for EnumMeta { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl Spanned for EnumMeta { | ||||
|     fn span(&self) -> proc_macro2::Span { | ||||
| impl ToTokens for EnumMeta { | ||||
|     fn to_tokens(&self, tokens: &mut TokenStream) { | ||||
|         match self { | ||||
|             Self::ErrorTypeEnum { keyword, .. } => keyword.span(), | ||||
|             Self::ErrorTypeEnum { keyword, .. } => keyword.to_tokens(tokens), | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -143,13 +145,13 @@ impl Parse for VariantMeta { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl Spanned for VariantMeta { | ||||
|     fn span(&self) -> proc_macro2::Span { | ||||
| impl ToTokens for VariantMeta { | ||||
|     fn to_tokens(&self, tokens: &mut TokenStream) { | ||||
|         match self { | ||||
|             Self::ErrorType { keyword, .. } => keyword.span, | ||||
|             Self::Code { keyword, .. } => keyword.span, | ||||
|             Self::Message { keyword, .. } => keyword.span, | ||||
|             Self::Ignore { keyword, .. } => keyword.span, | ||||
|             Self::ErrorType { keyword, .. } => keyword.to_tokens(tokens), | ||||
|             Self::Code { keyword, .. } => keyword.to_tokens(tokens), | ||||
|             Self::Message { keyword, .. } => keyword.to_tokens(tokens), | ||||
|             Self::Ignore { keyword, .. } => keyword.to_tokens(tokens), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Narayan Bhat
					Narayan Bhat