1
0
mirror of https://github.com/danog/strum.git synced 2024-11-30 04:28:59 +01:00

Add doc comment to FromRepr macro (#202)

This will help people who have missing_docs denied.
This commit is contained in:
LJ 2022-01-08 22:08:45 +02:00 committed by GitHub
parent 0c80602333
commit ced17d4c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,6 +128,7 @@ pub fn from_repr_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
Ok(quote! {
impl #impl_generics #name #ty_generics #where_clause {
#[doc = "Try to create [Self] from the raw representation"]
#vis #const_if_possible fn from_repr(discriminant: #discriminant_type) -> Option<#name #ty_generics> {
#(#constant_defs)*
match discriminant {