diff options
Diffstat (limited to 'src/document_tree/extra_attributes.rs')
| -rw-r--r-- | src/document_tree/extra_attributes.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/document_tree/extra_attributes.rs b/src/document_tree/extra_attributes.rs index 0708080..d73cdec 100644 --- a/src/document_tree/extra_attributes.rs +++ b/src/document_tree/extra_attributes.rs @@ -1,7 +1,7 @@ use serde_derive::Serialize; use crate::target; -use super::attribute_types::{FixedSpace,ID,NameToken,AlignHV,AlignH,Measure,EnumeratedListType}; +use super::attribute_types::{CanBeEmpty,FixedSpace,ID,NameToken,AlignHV,AlignH,Measure,EnumeratedListType}; pub trait ExtraAttributes<A> { fn with_extra(extra: A) -> Self; @@ -9,14 +9,6 @@ pub trait ExtraAttributes<A> { fn extra_mut(&mut self) -> &mut A; } -/* -macro_rules! skip { - (Option<$type:ty>) => { #[serde(skip_serializing_if = "Option::is_none")] }; - (Vec <$type:ty>) => { #[serde(skip_serializing_if = "Vec::is_empty" )] }; - (bool ) => { #[serde(skip_serializing_if = "Not::not" )] }; -} -*/ - macro_rules! impl_extra { ( $name:ident { $( $(#[$pattr:meta])* $param:ident : $type:ty ),* $(,)* } ) => ( impl_extra!( @@ -28,7 +20,7 @@ macro_rules! impl_extra { $(#[$attr])+ pub struct $name { $( $(#[$pattr])* - // skip!($type) + #[serde(skip_serializing_if = "CanBeEmpty::is_empty")] pub $param : $type, )* } ); |
