Skip to content

Instantly share code, notes, and snippets.

@eaglgenes101
Created September 8, 2018 16:14
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 eaglgenes101/e752afc7ddf544dbf4f6382022dceae2 to your computer and use it in GitHub Desktop.
Save eaglgenes101/e752afc7ddf544dbf4f6382022dceae2 to your computer and use it in GitHub Desktop.
macro_rules! variant_enum {
(
$variant:ident {
$(
$( #[ $oemval:meta ] )*
$oldvariant:ident => $newvariant:ident
),*
}
) => {
enum $variant {
$(
matching_field_extraction!(
$variant {
$( #[ $oemval ] )*
$oldvariant => $newvariant
}
);
),*
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment