Skip to content

Commit

Permalink
Using fn() -> T instead of T in the phantom data will make all EnumIt…
Browse files Browse the repository at this point in the history
…erator types Send + Sync. (#402)

Co-authored-by: Peter Glotfelty <peter@glotfelty.us>
  • Loading branch information
Peternator7 and Peter Glotfelty authored Feb 8, 2025
1 parent 1e6928c commit 46cf82b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions strum_macros/src/macros/enum_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {

let phantom_data = if gen.type_params().count() > 0 {
let g = gen.type_params().map(|param| &param.ident);
quote! { < ( #(#g),* ) > }
quote! { < fn() -> ( #(#g),* ) > }
} else {
quote! { < () > }
quote! { < fn() -> () > }
};

let variants = match &ast.data {
Expand Down

0 comments on commit 46cf82b

Please sign in to comment.