Support trait-only and impl-only attributes
Resolve issue #41 by introducing #[ext_attr(trait_only)] and #[ext_attr(impl_only)] attributes to specify trait-only and impl-only attributes respectively.
#[ext(TraitOnlyExample)]
#[ext_attr(trait_only)]
#[my_trait_only_attr]
impl String {
fn foo(&self) {}
}
#[ext(ImplOnlyExample)]
impl String {
#[ext_attr(impl_only)]
#[my_impl_only_attr]
fn foo(&self) {}
}
One thing. Maybe the impl_attr/trait_attr can be wrapped in #[ext(impl_attr/trait_attr)] to make it obvious which macro they come from
One thing. Maybe the
impl_attr/trait_attrcan be wrapped in#[ext(impl_attr/trait_attr)]to make it obvious which macro they come from
Good point. I looked around and your naming style indeed seems more idomatic--see serde attributes for example.
Will make the change.
One thing. Maybe the
impl_attr/trait_attrcan be wrapped in#[ext(impl_attr/trait_attr)]to make it obvious which macro they come fromGood point. I looked around and your naming style indeed seems more idomatic--see serde attributes for example.
Will make the change.
Updated. But instead of #[ext(impl_attr/trait_attr)] I went with #[ext_attr(impl_only/trait_only)] to clearly distinguish between main #[ext] attribute.