serde-rs / serde-rs.github.io

https://serde.rs
Creative Commons Attribution Share Alike 4.0 International
22 stars 96 forks source link

Add more description of internally tagged enum representation #138

Closed ghost closed 1 year ago

ghost commented 2 years ago

Using a #[serde(tag = "...")] attribute on an enum containing a tuple variant with one element will be compiled without any compile-time error.

Before:

Using a #[serde(tag = "...")] attribute on an enum containing a tuple variant is an error at compile time.

After:

Using a #[serde(tag = "...")] attribute on an enum containing a tuple variant with more than one element is an error at compile time.

ghost commented 2 years ago

serde/src/private/ser.rs#L96-L336