Fix newtype variant unwrapping inside enum, seq and map#331
Conversation
|
Hey, thanks for the follow-up! I'm not sure when I will be able to review this.
I don't think there's anything special to do for |
|
I guess it might be easiest then to just turn off the newtype variant unwrapping if we enter |
|
@torkleyy I've disabled newtype variant unwrapping inside |
Fix newtype variant unwrapping inside enum, seq and map
This is a follow-up to #319 which added the
unwrap_variant_newtypesextension.Unfortunately, it seems like I missed a few interactions with parsing enums, sequences and maps nested inside a newtype variant (i.e. not inside a containing non-newtype struct). I have fixed all three and added extra test cases to cover their intended functionality, i.e.
NewtypeVariant( [ Struct(...) ] ),NewtypeVariant( { "key": Struct(...) } ), andNewtypeVariant( StructVariant(...) )all parse again.Discussion
Option<T>is another fun case. Here I think carrying through the unwrapping actually is quite neat, but I want to get your input if this should be the intended behaviour:NewtypeVariant( None )NewtypeVariant( Some(a: 4, bool: false) )forOption<Struct>andstruct Struct { a: u32, b: bool }NewtypeVariant( a: 4, bool: false )is theimplicit_someextension is switched on as wellI am also a bit unsure about how to handle
deserialize_any. I think I may need your help with that one.TODO
CHANGELOG.md