Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Serialize enums as maps by default #118

Merged
merged 1 commit into from
Jun 9, 2019
Merged

Serialize enums as maps by default #118

merged 1 commit into from
Jun 9, 2019

Conversation

pyfisch
Copy link
Owner

@pyfisch pyfisch commented Jun 9, 2019

This matches other serde formats.
Directly set options on Serializer.
Remove rarely used to_* methods.

Closes #85

@pyfisch
Copy link
Owner Author

pyfisch commented Jun 9, 2019

Search results reveal that to_vec, to_writer and to_vec_packed are primarily used. Other methods such as to_vec_sd are only rarely needed. Therefore users should directly call the Serializer in this case.

@pyfisch
Copy link
Owner Author

pyfisch commented Jun 9, 2019

Regarding #117, I felt that a config struct without accessors may hinder future extensibility and a separate builder was too much complexity.

It is now possible in theory so change the options in the middle of serialization and shoot yourself in the foot but this requires some effort on the users side.

@sfackler
Copy link
Collaborator

sfackler commented Jun 9, 2019

Yeah, I think just having setters on Serializer/Deserializer for options makes sense.

This matches other serde formats.
Directly set options on Serializer.
Remove rarely used to_* methods.
@pyfisch pyfisch merged commit 2a63501 into master Jun 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change enum serialization
2 participants