Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert enum to string? #194

Open
tdudz opened this issue Jun 14, 2021 · 0 comments
Open

convert enum to string? #194

tdudz opened this issue Jun 14, 2021 · 0 comments

Comments

@tdudz
Copy link

tdudz commented Jun 14, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant