Skip to content

Commit

Permalink
Fix doc comment for EnumIter (Peternator7#242)
Browse files Browse the repository at this point in the history
Comment now says that it iterates over variants of the enum rather than
variants of `Self`, which would be the iterator.
  • Loading branch information
mikeleany authored Oct 15, 2022
1 parent 93d0886 commit dd0c2fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion strum_macros/src/macros/enum_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
let vis = &ast.vis;
let type_properties = ast.get_type_properties()?;
let strum_module_path = type_properties.crate_module_path();
let doc_comment = format!("An iterator over the variants of [{}]", name);

if gen.lifetimes().count() > 0 {
return Err(syn::Error::new(
Expand Down Expand Up @@ -65,7 +66,7 @@ pub fn enum_iter_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
let iter_name = syn::parse_str::<Ident>(&format!("{}Iter", name)).unwrap();

Ok(quote! {
#[doc = "An iterator over the variants of [Self]"]
#[doc = #doc_comment]
#[allow(
missing_copy_implementations,
missing_debug_implementations,
Expand Down

0 comments on commit dd0c2fa

Please sign in to comment.