Skip to content

Untagged enum roundtrip issues #500

@juntyr

Description

@juntyr

The following cases do not roundtrip:

  • untagged struct variant with PrettyConfig::default().struct_names(true), since
  • raw value inside an untagged enum
    • raw values are serialized without any indication that they exist, as is their purpose
    • untagged enums deserialize into serde's content type, which will parse the raw value's content as normal RON
    • the raw value cannot be deserialized from deserialized ron
    • e.g. "\"hi\"" is the raw value "\"hi\"" but the serde content "hi"
    • this could only be solved with a custom content type, which is blocked Internal buffering disrupts format-specific deserialization features serde-rs/serde#1183

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions