Re: [PATCH v2 1/2] rust: macros: Add derive Display for enums
From: Danilo Krummrich
Date: Mon Jan 05 2026 - 12:26:48 EST
On Mon Jan 5, 2026 at 3:42 PM CET, Benno Lossin wrote:
> I'm still skeptical about having a derive macro for `Display`. What
> about adding & deriving the following trait instead:
>
> pub trait EnumVariantName {
> fn variant_name(&self) -> &'static str;
> }
With a derive macro for this trait, that sounds absolutely reasonable -- a
corresponding Display implementation becomes trivial with this.