move attributes to common part

This commit is contained in:
Marc-Antoine Arnaud 2018-04-10 11:22:18 +02:00
parent a5fb60a5c0
commit 61f9badbe7
6 changed files with 5 additions and 8 deletions

View File

@ -28,9 +28,7 @@ fn get_value(iter: &mut TokenTreeIter) -> Option<String> {
} }
impl YaSerdeAttribute { impl YaSerdeAttribute {
pub fn parse(attrs: &Vec<Attribute>) -> YaSerdeAttribute { pub fn parse(attrs: &Vec<Attribute>) -> YaSerdeAttribute {
let mut root = None; let mut root = None;
let mut rename = None; let mut rename = None;
let mut attribute = false; let mut attribute = false;

View File

@ -1,5 +1,5 @@
use de::attribute::*; use attribute::*;
use de::field_type::*; use de::field_type::*;
use quote::Tokens; use quote::Tokens;
use syn::Ident; use syn::Ident;

View File

@ -1,8 +1,8 @@
pub mod attribute;
pub mod expand_struct; pub mod expand_struct;
pub mod field_type; pub mod field_type;
use attribute;
use proc_macro2::Span; use proc_macro2::Span;
use quote; use quote;
use syn; use syn;

View File

@ -6,6 +6,7 @@ extern crate proc_macro2;
extern crate quote; extern crate quote;
extern crate syn; extern crate syn;
mod attribute;
mod de; mod de;
mod ser; mod ser;

View File

@ -1,5 +1,5 @@
use de::attribute::*; use attribute::*;
use de::field_type::*; use de::field_type::*;
use quote::Tokens; use quote::Tokens;
use syn::Ident; use syn::Ident;

View File

@ -1,9 +1,7 @@
// pub mod attribute;
pub mod expand_struct; pub mod expand_struct;
// pub mod field_type;
use de::attribute; use attribute;
use proc_macro2::Span; use proc_macro2::Span;
use quote; use quote;