use super::RenderHtml;
use crate::html::attribute::Attribute;
pub trait AddAnyAttr {
type Output<SomeNewAttr: Attribute>: RenderHtml;
fn add_any_attr<NewAttr: Attribute>(
self,
attr: NewAttr,
) -> Self::Output<NewAttr>
where
Self::Output<NewAttr>: RenderHtml;
}
#[macro_export]
macro_rules! no_attrs {
($ty_name:ty) => {
impl<'a> $crate::view::add_attr::AddAnyAttr for $ty_name {
type Output<SomeNewAttr: $crate::html::attribute::Attribute> =
$ty_name;
fn add_any_attr<NewAttr: $crate::html::attribute::Attribute>(
self,
_attr: NewAttr,
) -> Self::Output<NewAttr> {
self
}
}
};
}