Skip to content

⏰ Add td_*seconds serde Serialize and Deserialize functions for TimeDelta #1652

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

tosti007
Copy link

Fixes #117

This PR copy-pastes the current implementation for DateTime such that we have equal implementations for DeltaTime.

I opted to add the logic to the existing serde.rs file. However, I think this might be the wrong place and a better solution would be to move the main.rs's serde module combined with this serde.rs file to a separate src/serde.rs file, thoughts?

PS:
I am just doing a drive-by PR on this crate, so I don't really know what the exact requirements are regarding testing ect. Please let me know!

@tosti007 tosti007 changed the title Add td_*seconds serde Serialize and Deserialize functions for TimeDelta ⏰ Add td_*seconds serde Serialize and Deserialize functions for TimeDelta Jan 16, 2025
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

I'd like to see at least one basic round-tripping test for each of these.

@pistomat
Copy link

I can't wait for this PR to be merged!

@tosti007
Copy link
Author

I can't wait for this PR to be merged!

Thanks for the ping, I totally forgot about this. I'll see if I can get it in a good state somewhere this week.

Copy link

codecov bot commented May 26, 2025

Codecov Report

Attention: Patch coverage is 78.55711% with 107 lines in your changes missing coverage. Please review.

Project coverage is 90.26%. Comparing base (3b4af71) to head (51ee664).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/datetime/serde.rs 80.00% 98 Missing ⚠️
src/lib.rs 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1652      +/-   ##
==========================================
- Coverage   90.59%   90.26%   -0.33%     
==========================================
  Files          38       38              
  Lines       16028    16463     +435     
==========================================
+ Hits        14520    14860     +340     
- Misses       1508     1603      +95     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tosti007
Copy link
Author

tosti007 commented Jun 4, 2025

I see codecov says no, I haven't really used that before. Does that mean it just requires more tests which touch the added codepaths?

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.

Add Serialize/Deserialize for Duration
3 participants