zefchain / serde-reflection

Rust libraries and tools to help with interoperability and testing of serialization formats based on Serde.
Apache License 2.0
139 stars 26 forks source link

[Bug] `VariantFormat::Unit` missing inner value #45

Open MrFoxPro opened 2 months ago

MrFoxPro commented 2 months ago

Consider following enum:

pub enum UnitEnum {
    ONE   = 5,
    THREE = 3,
    FIVE  = 1,
}

This produces container:

Enum(
    {
        0: Named {
            name: "ONE",
            value: Unit,
        },
        1: Named {
            name: "THREE",
            value: Unit,
        },
        2: Named {
            name: "FIVE",
            value: Unit,
        },
    },
)

But missing actual inner values