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
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 liketo_string()
?the current way i am doing it requires a somewhat ugly
format!("{:?}", foo)
since the enums have theDebug
traiti migrated from
rust-protobuf
to this library, and they had ato_string()
func