Skip to content

Commit

Permalink
fix(macros): enumerate after filtering (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
cAttte authored Nov 4, 2024
1 parent 8509af0 commit 03b4e9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions specta-macros/src/type/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ pub fn parse_enum(
let generic_idents = generics
.params
.iter()
.enumerate()
.filter_map(|(i, p)| match p {
GenericParam::Type(t) => Some((i, &t.ident)),
.filter_map(|p| match p {
GenericParam::Type(t) => Some(&t.ident),
_ => None,
});
})
.enumerate();

let definition_generics = generic_idents.clone().map(|(_, ident)| {
let ident = ident.to_string();
Expand Down
6 changes: 3 additions & 3 deletions specta-macros/src/type/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ pub fn parse_struct(
let generic_idents = generics
.params
.iter()
.enumerate()
.filter_map(|(i, p)| match p {
GenericParam::Type(t) => Some((i, &t.ident)),
.filter_map(|p| match p {
GenericParam::Type(t) => Some(&t.ident),
_ => None,
})
.enumerate()
.collect::<Vec<_>>();

let reference_generics = generic_idents.iter().map(|(i, ident)| {
Expand Down

0 comments on commit 03b4e9a

Please sign in to comment.