quick-protobuf icon indicating copy to clipboard operation
quick-protobuf copied to clipboard

convert enum to string?

Open tdudz opened this issue 4 years ago • 0 comments

is there a way to nicely convert an enum to its string representation? I see that there is a (very useful) from(&str) method, but what about the inverse, something like to_string()?

the current way i am doing it requires a somewhat ugly format!("{:?}", foo) since the enums have the Debug trait

i migrated from rust-protobuf to this library, and they had a to_string() func

tdudz avatar Jun 14 '21 17:06 tdudz