diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aeca7ca..a9805322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ([#297](https://github.com/JelteF/derive_more/pull/297)) - Hygiene of macro expansions in presence of custom `core` crate. ([#327](https://github.com/JelteF/derive_more/pull/327)) +- Fix documentation of generated methods in `IsVariant` derive. ## 0.99.10 - 2020-09-11 diff --git a/impl/src/is_variant.rs b/impl/src/is_variant.rs index d6fab316..12f7db1e 100644 --- a/impl/src/is_variant.rs +++ b/impl/src/is_variant.rs @@ -39,10 +39,9 @@ pub fn expand(input: &DeriveInput, trait_name: &'static str) -> Result quote! { (..) }, Fields::Unit => quote! {}, }; - let variant_name = stringify!(variant_ident); let func = quote! { #[doc = "Returns `true` if this value is of type `"] - #[doc = #variant_name] + #[doc = stringify!(#variant_ident)] #[doc = "`. Returns `false` otherwise"] #[inline] #[must_use]