-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
This crate is amazing for tackling a lot of boilerplate code and also ensuring variant name changes propagate to the trait implementations. I use AsRefStr and EnumString quite a lot.
However, a lot of times I've found myself in the situation of having something like this:
enum MyEnum {
A,
B,
C,
Other(String)
}Afaik there's no way of propagating the AsRef<str> or FromStr implementations to the underlying String. What do you think about implementing a transparent argument to the attribute, similar to #[serde(transparent)] - only for one field provided in an unnamed/named fashion.
So then we could do:
#[derive(AsRefStr, EnumStr)]
enum MyEnum {
A,
B,
C,
#[strum(transparent)]
Other(String)
}I could try and pick this up if you like the idea. I think it would be handy for a lot of people.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels