You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To me, it seems that a tagged newtype variant containing () should be serializable/deserializable in the same way as unit variants. Specificly I have the following enum:
I'd expect Success(()) to pe deserialized from and serialized to { "result": "success"}, but that doesn't seem to be the case. It doesn't work to deserialize it and when I try to serialize it (with serde_json) I get the following error:
To me, it seems that a tagged newtype variant containing
()
should be serializable/deserializable in the same way as unit variants. Specificly I have the following enum:I'd expect
Success(())
to pe deserialized from and serialized to{ "result": "success"}
, but that doesn't seem to be the case. It doesn't work to deserialize it and when I try to serialize it (with serde_json) I get the following error:Is there any reason why this doesn't work, or should we fix this? I'd would be happy to make a PR.
The text was updated successfully, but these errors were encountered: