1
0
mirror of https://github.com/danog/strum.git synced 2024-11-26 12:04:38 +01:00

Fix doc comment for EnumIter (#242)

Comment now says that it iterates over variants of the enum rather than
variants of `Self`, which would be the iterator.
This commit is contained in:
Mike Leany 2022-10-15 12:59:55 -06:00 committed by GitHub
parent 93d0886377
commit dd0c2fa785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(
@ -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,