enum_variant_name_const 0.1.1

Proc-macro that adds a const fn returning the variant name of an enum
Documentation

#[derive(EnumVariantNameConst)]

Adds

pub const fn variant_name(&self) -> &'static str

to the enum, returning the precise identifier of the variant (“A”, “B”, …) and usable in const contexts.