-
Notifications
You must be signed in to change notification settings - Fork 123
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
Untagged enums don't deserialize newtype variants which are enums properly #492
Comments
juntyr
added a commit
to juntyr/ron
that referenced
this issue
Aug 31, 2023
This has been fixed in #451 - I'll add your test case to the test suite to ensure that it remains fixed. |
juntyr
added a commit
to juntyr/ron
that referenced
this issue
Aug 31, 2023
Co-authored-by: Stumblinbear <stumblinbear@gmail.com>
The fix should be released in v0.9, which I'm hoping to release in 1-2 weeks :) |
juntyr
added a commit
that referenced
this issue
Aug 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following implementation
This is set up like this to allow using a raw String literal or a fallback which executes different behavior (in this case reading the string from the environment), but only if it's wrapped in
Env
.The following works properly:
MaybeEnv::Value("foo")
outputs"foo"
MaybeEnv::Other(Other::Env("bar"))
outputsEnv("bar")
"foo"
results inMaybeEnv::Value("foo")
However, when deserializing
Env("bar")
it fails with"data did not match any variant of untagged enum MaybeEnv"
instead ofMaybeEnv::Other(Other::Env("bar"))
. I'm also unable to find a string which properly deserializes to this value at all.I'm unsure if this is a serde limitation, but it's relatively surprising behavior since it serializes properly but fails to deserialize.
The text was updated successfully, but these errors were encountered: