#![cfg(feature = "macros")]
#[macro_export]
macro_rules! fmt_wrapper {
(impl $s:ident<$T:ident>.$field:ident { $($trait:ident),* $(,)? }) => {
$(
$crate::fmt_wrapper!(@impl $s<$T>::$trait.$field);
)*
};
(impl $s:ident<$T:ident>$(.$field:ident)? { $($trait:ident),* $(,)? }) => {
$(
$crate::fmt_wrapper!(@impl $s<$T>::$trait.0);
)*
};
(@impl $s:ident<$T:ident>::$trait:ident.$field:tt) => {
impl<$T> ::core::fmt::$trait for $s<$T>
where
$T: ::core::fmt::$trait
{
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::$trait::fmt(&self.$field, f)
}
}
};
}