Skip to content

Instantly share code, notes, and snippets.

@palfrey
Last active December 31, 2018 11:20
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 palfrey/48588761e085fe12f5d79b1c7936f1af to your computer and use it in GitHub Desktop.
Save palfrey/48588761e085fe12f5d79b1c7936f1af to your computer and use it in GitHub Desktop.
let ast: syn::ItemFn = syn::parse(input).unwrap();
let name = ast.ident;
let block = ast.block;
let attrs = ast.attrs;
let gen = quote! {
#(#attrs)
*
fn #name () {
serial_test::serial_core(#key, || {
#block
});
}
};
return gen.into();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment