Skip to content

Commit

Permalink
Merge branch 'iter-traits' of https://github.com/jwodder/strum into j…
Browse files Browse the repository at this point in the history
…wodder-iter-traits
  • Loading branch information
Peter Glotfelty committed Oct 29, 2023
2 parents e8b2ff1 + 7831f6f commit 9660ec4
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions strum_macros/src/macros/enum_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {

Ok(quote! {
#[doc = #doc_comment]
#[allow(
missing_copy_implementations,
)]
#[derive(Clone, Copy, Eq, PartialEq)]
#vis struct #iter_name #ty_generics {
idx: usize,
back_idx: usize,
Expand Down Expand Up @@ -159,14 +157,6 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
}
}

impl #impl_generics Clone for #iter_name #ty_generics #where_clause {
fn clone(&self) -> #iter_name #ty_generics {
#iter_name {
idx: self.idx,
back_idx: self.back_idx,
marker: self.marker.clone(),
}
}
}
impl #impl_generics ::core::iter::FusedIterator for #iter_name #ty_generics #where_clause { }
})
}

0 comments on commit 9660ec4

Please sign in to comment.