Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually implemented RawObjectId de/serialization to/from string #368

Merged

Conversation

agg23
Copy link
Contributor

@agg23 agg23 commented Dec 2, 2021

The standard serde de/serialize implementations stored the RawObjectId u128 as a limited precision number, such as 1.2193937513084523e+38. This custom implementation stores the value instead as a human readable string.

We could instead serialize this as a byte array for efficiency, but since the serde_json format is a lower efficiency mechanism anyway, I think defaulting to readability is better.

@Dessix
Copy link
Contributor

Dessix commented Apr 11, 2022

I would advise implementing human-readable versus compact formats as used in serde-rs/serde#1044 to allow human-readable while also using compact-encode during binary serialization.

@Dessix Dessix self-requested a review April 13, 2022 22:36
Copy link
Contributor

@Dessix Dessix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking as changes-requested; see prior comment about the human_readable flag on serializers.

@shanemadden shanemadden merged commit fd6d173 into rustyscreeps:bindgen Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants