Skip to content

flatten every sequence-shaped value, not only a serde seq - #11

Merged
ahl merged 1 commit into
mainfrom
flatten-array-forms
Nov 13, 2026
Merged

ahl merged 1 commit into
mainfrom
flatten-array-forms

Conversation

@ahl

@ahl ahl commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

The flattening helpers took a serde seq and rejected everything else at the data-model layer, so a tuple, a fixed-size array, a tuple struct, or a newtype struct around one of these failed to splice even though JSON writes each as an array. The serializer now treats serialize_tuple and serialize_tuple_struct like serialize_seq and forwards a newtype struct to its inner value; the deserializer visits the remaining elements for a tuple or tuple struct and forwards a newtype struct the same way. Variants stay rejected, since their tag is not part of an array.

The flattening helpers took a serde seq and rejected everything else at
the data-model layer, so a tuple, a fixed-size array, a tuple struct,
or a newtype struct around one of these failed to splice even though
JSON writes each as an array. The serializer now treats serialize_tuple
and serialize_tuple_struct like serialize_seq and forwards a newtype
struct to its inner value; the deserializer visits the remaining
elements for a tuple or tuple struct and forwards a newtype struct the
same way. Variants stay rejected, since their tag is not part of an
array.
@ahl
ahl merged commit 9a5346d into main Nov 13, 2026
9 checks passed
@ahl
ahl deleted the flatten-array-forms branch November 13, 2026 04:54
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