mitsuhiko / deser

Experimental rust serialization library
https://docs.rs/deser
Apache License 2.0
287 stars 8 forks source link

Add basic struct flattening support #16

Closed mitsuhiko closed 2 years ago

mitsuhiko commented 2 years ago

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: