3Hren / 3Hren/msgpack-rust

Why serialize newtype struct as array?

Open
#129 15 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.4k
Forks
162
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.