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

strum::Display doesn't work with non-unit non-string variants #306

Closed
Keshi opened this issue Oct 13, 2023 · 0 comments · Fixed by #308
Closed

strum::Display doesn't work with non-unit non-string variants #306

Keshi opened this issue Oct 13, 2023 · 0 comments · Fixed by #308

Comments

@Keshi
Copy link

Keshi commented Oct 13, 2023

strum::Display and #[strum(default)] doesn't work with non-unit non-string variants. It should probably try to convert the enclosed tuple into a string?

#[derive(strum::Display)]
enum Color {
    Red,
    Blue,
    Green,
}
#[derive(strum::Display)]   <---- this fails: Mismatched types.
enum TestEnum {
    #[strum(default)]
    Color(Color),
}
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

Successfully merging a pull request may close this issue.

1 participant