Skip to content

fix: allow empty Map to deserialize as unit #33

Open
Adjective-Object wants to merge 2 commits intorushmorem:mainfrom
Adjective-Object:adjective-object/fix-empty-map-as-unit
Open

fix: allow empty Map to deserialize as unit #33
Adjective-Object wants to merge 2 commits intorushmorem:mainfrom
Adjective-Object:adjective-object/fix-empty-map-as-unit

Conversation

@Adjective-Object
Copy link

This is part of a series of small fixes bringing serde-content in line with serde's value visitor, to deal with edge-cases.

serde's ContentDeserializer allows empty Map to deserialize as unit ().
This is needed for internally tagged enums where the variant payload is ().

Reference: https://github.com/serde-rs/serde/blob/d17902059e77e371d8a7f83ff403f9e760b70f45/serde/src/private/de.rs#L1301-L1318

serde's ContentDeserializer allows empty Map to deserialize as unit `()`.
This is needed for internally tagged enums where the variant payload is `()`.

Reference: https://github.com/serde-rs/serde/blob/d17902059e77e371d8a7f83ff403f9e760b70f45/serde/src/private/de.rs#L1301-L1318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant