diff --git a/src/lib.rs b/src/lib.rs index 84f12b0..1cba497 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,34 +4,10 @@ mod ser; pub(crate) mod attr; use syn::{ - parse_macro_input, DeriveInput, Error, Data, Ident, Result, + parse_macro_input, DeriveInput, Error, Data, }; use std::convert::From; -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - assert_eq!(2 + 2, 4); - } -} - -#[derive(Debug)] -pub(crate) struct Variant { - ident: Ident, - name: Option, -} - -impl From<&syn::Variant> for Variant { - fn from(v: &syn::Variant) -> Self { - let ident = v.ident.clone(); - Variant { - ident, - name: None, - } - } -} - #[derive(Debug)] enum TagType { External, diff --git a/src/ser.rs b/src/ser.rs index 62a1ad8..2dc854d 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -3,7 +3,7 @@ use syn::{ DeriveInput, Result, DataEnum, Error, Fields, FieldsNamed, }; use quote::quote; -use crate::{Variant, TagType}; +use crate::TagType; use crate::attr; pub fn derive(input: &DeriveInput, enumeration: &DataEnum) -> Result { @@ -14,7 +14,6 @@ pub fn derive(input: &DeriveInput, enumeration: &DataEnum) -> Result = enumeration.variants.iter().map(Into::into).collect(); let tag_type = attr::tag_type(&input.attrs, &enumeration)?; let names = enumeration.variants .iter()