Open Luro02 opened 4 years ago
That makes sense. As best we can, we should be able to round trip from strings so we also need the reverse direction string -> Enum.
Is this something you'd be interested in openin a PR for?
Is this something you'd be interested in openin a PR for?
Sorry I do not have the time right now :/
#[derive(Debug, Display)]
enum Series {
#[strum(to_string = "series.media")]
Media,
}
#[test]
fn case_assert() {
assert_eq!("series.media", Series::Media.to_string());
}
Now can it solved?
I would like to be able to do something like this
The attribute could also look like this
The implementation would be relatively simple (I think?):