Given:
trait Foo {
fn bar(self);
}
fn main() {
Foo::bar(1i32);
}
We can implement Foo for i32 currently with a macro if we wish as:
macro_rules! impl_bar {
() => (
fn bar(self) { return () }
);
}
impl Foo for i32 {
impl_bar!();
}
But wouldn’t it be cool if we could do something like:
impl Foo for i32 {
macro bar {
(...) => (...)
}
}
Thoughts?