update format
This commit is contained in:
		
							parent
							
								
									e691fba686
								
							
						
					
					
						commit
						9db35415a0
					
				| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| use proc_macro2::TokenTree; | use proc_macro2::TokenTree; | ||||||
| use proc_macro2::Delimiter; | use proc_macro2::Delimiter; | ||||||
| use proc_macro2::token_stream::IntoIter; | use proc_macro2::token_stream::IntoIter; | ||||||
| @ -16,7 +15,9 @@ pub struct YaSerdeAttribute { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| fn get_value(iter: &mut IntoIter) -> Option<String> { | fn get_value(iter: &mut IntoIter) -> Option<String> { | ||||||
|   if let (Some(TokenTree::Punct(operator)), Some(TokenTree::Literal(value))) = (iter.next(), iter.next()) { |   if let (Some(TokenTree::Punct(operator)), Some(TokenTree::Literal(value))) = | ||||||
|  |     (iter.next(), iter.next()) | ||||||
|  |   { | ||||||
|     if operator.as_char() == '=' { |     if operator.as_char() == '=' { | ||||||
|       Some(value.to_string().replace("\"", "")) |       Some(value.to_string().replace("\"", "")) | ||||||
|     } else { |     } else { | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ use std::collections::BTreeMap; | |||||||
| use syn::Fields; | use syn::Fields; | ||||||
| use syn::Ident; | use syn::Ident; | ||||||
| use syn::DataEnum; | use syn::DataEnum; | ||||||
| use proc_macro2::{TokenStream, Span}; | use proc_macro2::{Span, TokenStream}; | ||||||
| 
 | 
 | ||||||
| pub fn parse( | pub fn parse( | ||||||
|   data_enum: &DataEnum, |   data_enum: &DataEnum, | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ use quote::TokenStreamExt; | |||||||
| use std::collections::BTreeMap; | use std::collections::BTreeMap; | ||||||
| use syn::Ident; | use syn::Ident; | ||||||
| use syn::DataStruct; | use syn::DataStruct; | ||||||
| use proc_macro2::{TokenStream, Span}; | use proc_macro2::{Span, TokenStream}; | ||||||
| 
 | 
 | ||||||
| pub fn parse( | pub fn parse( | ||||||
|   data_struct: &DataStruct, |   data_struct: &DataStruct, | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ pub mod expand_enum; | |||||||
| pub mod expand_struct; | pub mod expand_struct; | ||||||
| 
 | 
 | ||||||
| use attribute; | use attribute; | ||||||
| use proc_macro2::{TokenStream, Span}; | use proc_macro2::{Span, TokenStream}; | ||||||
| use syn; | use syn; | ||||||
| use syn::Ident; | use syn::Ident; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ use std::collections::BTreeMap; | |||||||
| use syn::Fields; | use syn::Fields; | ||||||
| use syn::Ident; | use syn::Ident; | ||||||
| use syn::DataEnum; | use syn::DataEnum; | ||||||
| use proc_macro2::{TokenStream, Span}; | use proc_macro2::{Span, TokenStream}; | ||||||
| 
 | 
 | ||||||
| pub fn serialize( | pub fn serialize( | ||||||
|   data_enum: &DataEnum, |   data_enum: &DataEnum, | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ use quote::TokenStreamExt; | |||||||
| use std::collections::BTreeMap; | use std::collections::BTreeMap; | ||||||
| use syn::Ident; | use syn::Ident; | ||||||
| use syn::DataStruct; | use syn::DataStruct; | ||||||
| use proc_macro2::{TokenStream, Span}; | use proc_macro2::{Span, TokenStream}; | ||||||
| use std::string::ToString; | use std::string::ToString; | ||||||
| 
 | 
 | ||||||
| pub fn serialize( | pub fn serialize( | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ pub mod expand_enum; | |||||||
| pub mod expand_struct; | pub mod expand_struct; | ||||||
| 
 | 
 | ||||||
| use attribute; | use attribute; | ||||||
| use proc_macro2::{TokenStream, Span}; | use proc_macro2::{Span, TokenStream}; | ||||||
| use syn; | use syn; | ||||||
| use syn::Ident; | use syn::Ident; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user