From 49fdc71dbdc0b21bd431ee404654158946c4983c Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 6 Jun 2024 19:57:20 +0200 Subject: [PATCH] fix(apb): enums implement Display too --- apb/src/macros.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apb/src/macros.rs b/apb/src/macros.rs index dd062aae..28a9af32 100644 --- a/apb/src/macros.rs +++ b/apb/src/macros.rs @@ -38,6 +38,12 @@ macro_rules! strenum { $($deep($inner),)* } + impl std::fmt::Display for $enum_name { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{}", self.as_ref()) + } + } + impl AsRef for $enum_name { fn as_ref(&self) -> &str { match self {