mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 19:28:01 +00:00
feat(de): Support struct key hinting
Formats that do not provide type hints in the serialized format (bincode, redis) rely on hinting in the deserializer. Struct key hinting was not previously supported. This was not an issue in the past because bincode serializes structs as a keyless sequence of values. However, redis data is stored (key, value, key, value, ...), and the keys must be deserialized to properly create a struct. The default implementation of `visit_struct_key` is simply `visit` since that was the previous method called in codegen.
This commit is contained in:
@@ -917,7 +917,7 @@ fn deserialize_field_visitor(
|
||||
}
|
||||
}
|
||||
|
||||
deserializer.visit(__FieldVisitor::<D>{ phantom: PhantomData })
|
||||
deserializer.visit_struct_key(__FieldVisitor::<D>{ phantom: PhantomData })
|
||||
}
|
||||
}
|
||||
).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user