Skip to content

Implemented a consistent Eq trait for NaiveWeek. - #1687

Merged
djc merged 1 commit into
chronotope:mainfrom
Splashling1789:naiveweek-eq-fix
Apr 4, 2025
Merged

djc merged 1 commit into
chronotope:mainfrom
Splashling1789:naiveweek-eq-fix

Conversation

@Splashling1789

Copy link
Copy Markdown
Contributor

NaiveWeek previously exhibited an inconsistency in the derived Eq and PartialEq traits, as discussed in Issue #1686. This issue arose because the derived implementations did not accurately compare weeks when the arbitrary date field differed.

To resolve this, I have implemented a custom PartialEq trait that ensures accurate week comparisons based on the first day of the week. The Eq trait remains derived, relying on the updated functionality of PartialEq. Additionally, I have included a test to validate this implementation and ensure its correctness.

@codecov

codecov Bot commented Apr 3, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.62%. Comparing base (7c0bd13) to head (2b10b05).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1687      +/-   ##
==========================================
+ Coverage   90.60%   90.62%   +0.02%     
==========================================
  Files          38       38              
  Lines       16830    16867      +37     
==========================================
+ Hits        15249    15286      +37     
  Misses       1581     1581              

☔ 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.

@djc

djc commented Apr 3, 2025

Copy link
Copy Markdown
Member

Can you fix the formatting and squash your commits into a single one? I'll deal with the (unrelated) MSRV issue separately.

@djc

djc commented Apr 3, 2025 •

Copy link
Copy Markdown
Member

So clippy is suggesting that this should also get a custom Hash implementation (fixing the other, new, clippy issues and the MSRV issue in #1688).

@Splashling1789

Copy link
Copy Markdown
Contributor Author

Ok, it should be fine by now

@djc

djc commented Apr 3, 2025

Copy link
Copy Markdown
Member

The no_std build is failing. Please rebase on current main to fix the MSRV issue.

@Splashling1789

Copy link
Copy Markdown
Contributor Author

Okay, I think everything is fine now. Please let me know if there’s anything else!

@djc djc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@djc
djc merged commit b267a4f into chronotope:main Apr 4, 2025

This branch was previously deployed

1 inactive deployment
Coverage — 2b10b054 Deployed Apr 4, 2025 by Splashling1789
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.

2 participants