tafia / quick-protobuf

A rust implementation of protobuf parser
MIT License
446 stars 82 forks source link

convert enum to string? #194

Open tdudz opened 3 years ago

tdudz commented 3 years ago

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