Skip to content

Instantly share code, notes, and snippets.

@dfyz
Created October 26, 2018 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfyz/e84d59ff0b651849dc2b1f8d4bfd6fa8 to your computer and use it in GitHub Desktop.
Save dfyz/e84d59ff0b651849dc2b1f8d4bfd6fa8 to your computer and use it in GitHub Desktop.
trait Foo {}
trait Bar {}
macro_rules! implement_traits {
($type_name:ty) => {
impl Foo for $type_name {}
impl Bar for $type_name {}
};
}
struct A {}
implement_traits!(A);
fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment