Skip to content

Conversation

@rinde
Copy link
Contributor

@rinde rinde commented Feb 20, 2025

Our de-serialization code for Time and Duration was supporting several different formats that our serialization code didn't support. One downside of this approach is that it only supported self-describing formats (e.g. json) and it didn't support non self-describing formats (e.g. bincode).

This PR fixes that by removing the support to deserialize from different formats from within the deserializer, but it keeps the support to do so (e.g. RFC 3339). For example, custom (de)serialization can still be used with serde by utilizing serde functionality such as serialize_with.

This PR simplifies the serde code and adds tests for both json and bincode for all types.

@rinde rinde merged commit 482f6d4 into main Feb 20, 2025
3 checks passed
@rinde rinde deleted the fix-support-for-not-self-describing-serde branch February 20, 2025 13:51
@github-actions github-actions bot mentioned this pull request Feb 20, 2025
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