This implements basic flattening for flattening (#9). It takes advantage of the recent changes to eliminate the old MapSink and SeqSink but it needs a new unvetted OwnedSlot abstraction to allow deserializing into an adjacent slot.
There is an unsafe transmute in there which only exists because the borrow checker does not really understand loops (https://github.com/rust-lang/rust/issues/54663). I'm not sure if there is a way to get away without the transmute by finding some clever alternative ways to structure this code.
Remaining tasks:
[x] basic serialize
[x] basic deserialize
[x] support combined usage of skip_serializing_if and flatten
[x] figure out support for skip_serializing_optionals with flatten
This implements basic flattening for flattening (#9). It takes advantage of the recent changes to eliminate the old
MapSink
andSeqSink
but it needs a new unvettedOwnedSlot
abstraction to allow deserializing into an adjacent slot.There is an unsafe transmute in there which only exists because the borrow checker does not really understand loops (https://github.com/rust-lang/rust/issues/54663). I'm not sure if there is a way to get away without the transmute by finding some clever alternative ways to structure this code.
Remaining tasks:
skip_serializing_if
andflatten
skip_serializing_optionals
with flatten