-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: properly handle partial ordering in BoundPair constructor
This PR adds tests which highlighted a bug. The BoundPair::new() constructor was not correctly handling partially ordered types, particularly floating point NaN values. Changed the implementation to explicitly use partial_cmp instead of comparison operators, ensuring correct behavior with: - NaN floating point values - Custom partially ordered types - Infinite values - Regular numeric comparisons The new implementation satisfies Clippy's neg-cmp-op-on-partial-ord lint and makes the partial ordering handling explicit. Tests updated to verify correct behavior with floating point edge cases.
- Loading branch information
1 parent
a47b2b5
commit 8c74eb0
Showing
1 changed file
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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