#![allow(
clippy::missing_const_for_fn, clippy::std_instead_of_core, clippy::std_instead_of_alloc, clippy::alloc_instead_of_core, )]
mod smart_display {
pub(crate) mod delegate;
pub(crate) mod private_metadata;
}
use proc_macro::TokenStream;
macro_rules! attribute {
($($mod:ident)::+ => $public:ident) => {
#[doc = concat!("The `#[", attribute!(@stringify $($mod)+), "]` attribute.")]
#[proc_macro_attribute]
pub fn $public(attr: TokenStream, item: TokenStream) -> TokenStream {
match $($mod)::+::implementation(attr.into(), item.into()) {
Ok(ts) => ts.into(),
Err(err) => err.to_compile_error().into(),
}
}
};
(@stringify $first:ident $($remaining:ident)*) => {
concat!(stringify!($first), $("::", stringify!($remaining),)*)
};
}
attribute!(smart_display::delegate => smart_display_delegate);
attribute!(smart_display::private_metadata => smart_display_private_metadata);