defaulted 0.1.3

Trait and derive macro for testing whether a value equals its default state, with per-field customization and optional serde integration
Documentation
macro_rules! impl_defaulted_eq {
    ($type:ty, $val:expr) => {
        impl crate::Defaulted for $type
        {
            #[inline]
            fn is_defaulted(&self) -> bool
            {
                *self == $val
            }
        }
    };
}

macro_rules! impl_defaulted_empty {
    ($type:ty) => {
        impl crate::Defaulted for $type
        {
            #[inline]
            fn is_defaulted(&self) -> bool
            {
                self.is_empty()
            }
        }
    };
}

macro_rules! impl_defaulted_deref {
    (<$($gen:ident $(: $bound:path)?),*> for $type:ty) => {
        impl<$($gen $(: $bound)?),*> crate::Defaulted for $type
        where
            T: crate::Defaulted + ?Sized,
        {
            #[inline]
            fn is_defaulted(&self) -> bool
            {
                (**self).is_defaulted()
            }
        }
    };
}

mod core_impls;

#[cfg(feature = "alloc")]
mod alloc_impls;

#[cfg(feature = "std")]
mod std_impls;

#[cfg(feature = "bytes")]
mod bytes_impls;

#[cfg(feature = "indexmap")]
mod indexmap_impls;

#[cfg(feature = "serde-json")]
mod serde_json_impls;

#[cfg(feature = "serde-yaml")]
mod serde_yaml_impls;

#[cfg(feature = "smallvec")]
mod smallvec_impls;