-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
I'd love to be able to provide doc comments for the generated discriminants enum. I have a working local fork of strum, with the changes needed for this to work, which lets you do something like this:
use strum_macros::EnumDiscriminants;
#[derive(Debug, EnumDiscriminants)]
#[strum_discriminants(doc("Doc comment for the new enum."))]
#[strum_discriminants(doc("Split it into multiple lines if needed."))]
enum SourceEnum {
Variant0(bool),
Variant1(i32),
}This would generate a discriminants enum that looks something like this (derives omitted for brevity):
#[doc = "Doc comment for the new enum."]
#[doc = "Split it into multiple lines if needed."]
enum SourceEnumDiscriminants {
Variant0,
Variant1,
}If this looks good, I'd be happy to author a PR!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels