Skip to content

Why serialize newtype struct as array? #129

@SX91

Description

@SX91

https://github.com/3Hren/msgpack-rust/blob/master/rmp-serde/src/encode.rs#L375

Newtype is simply a wrapper around inner data, so it should encode/decode as inner data. You shouldn't really treat it as one-field struct IMO.
The same goes for newtype_variant: maybe it should be encoded as [index, value]? It would be the most compact representation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions