Skip to content

Commit

Permalink
filter out the current macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgunozerk committed Feb 4, 2025
1 parent ff978d3 commit cbb26eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/utils/pausable-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ pub fn when_not_paused(_attr: TokenStream, item: TokenStream) -> TokenStream {
let fn_vis = &input_fn.vis;
let fn_sig = &input_fn.sig;
let fn_block = &input_fn.block;
let fn_attrs = &input_fn.attrs; // get the other macros
// Filter out the current macro from attributes
let fn_attrs: Vec<_> =
input_fn.attrs.iter().filter(|attr| !attr.path().is_ident("when_not_paused")).collect();

let env_arg = if is_ref {
quote! { #env_ident }
Expand Down Expand Up @@ -82,7 +84,9 @@ pub fn when_paused(_attr: TokenStream, item: TokenStream) -> TokenStream {
let fn_vis = &input_fn.vis;
let fn_sig = &input_fn.sig;
let fn_block = &input_fn.block;
let fn_attrs = &input_fn.attrs; // get the other macros
// Filter out the current macro from attributes
let fn_attrs: Vec<_> =
input_fn.attrs.iter().filter(|attr| !attr.path().is_ident("when_paused")).collect();

let env_arg = if is_ref {
quote! { #env_ident }
Expand Down

0 comments on commit cbb26eb

Please sign in to comment.