Implemented a consistent Eq trait for NaiveWeek.#1687
Merged
djc merged 1 commit intochronotope:mainfrom Apr 4, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
Member
|
Can you fix the formatting and squash your commits into a single one? I'll deal with the (unrelated) MSRV issue separately. |
270f4ac to
9da25c4
Compare
61abaff to
1d9b7f0
Compare
Member
|
So clippy is suggesting that this should also get a custom |
be1afb7 to
17547f9
Compare
Contributor
Author
|
Ok, it should be fine by now |
Member
|
The no_std build is failing. Please rebase on current main to fix the MSRV issue. |
a0bc154 to
6a85301
Compare
Contributor
Author
|
Okay, I think everything is fine now. Please let me know if there’s anything else! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.