hydration
hydration copied to clipboard
Get rid of from_bytes/from_stream code duplication
Is your feature request related to a problem? Please describe.
from_bytes
and from_stream
have nearly identical code and functionality but are still duplicated
Describe the solution you'd like
Create a private deserialization method that uses an exhaustive generator to read the data to put into the objects. Then call it from both from_bytes
and from_stream
.
Additional context
This is probably a good time to rename all the hooks to pre_deserialization_hook
, post_deserialization_hook
, etc...