We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
asymmetry
PartialOrd
In the blog post tour of rust standard library traits, I feel the paragraph of asymmetry requirements in partial_cmp is not right:
partial_cmp
All PartialOrd impls must ensure that comparisons are asymmetric and transitive. That means for all a, b, and c: a < b implies !(a > b) (asymmetry) a < b && b < c implies a < c (transitivity)
All PartialOrd impls must ensure that comparisons are asymmetric and transitive. That means for all a, b, and c:
a
b
c
a < b
!(a > b)
a < b && b < c
a < c
In the document for PartialOrd, there is no part about asymmetry. The requirements for partial_cmp is:
The comparison must satisfy, for all a, b and c: transitivity: a < b and b < c implies a < c. The same must hold for both == and >. duality: a < b if and only if b > a.
The comparison must satisfy, for all a, b and c:
b < c
==
>
b > a
Maybe the document is updated and we should catch up?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In the blog post tour of rust standard library traits, I feel the paragraph of
asymmetry
requirements inpartial_cmp
is not right:In the document for PartialOrd, there is no part about
asymmetry
. The requirements forpartial_cmp
is:Maybe the document is updated and we should catch up?
The text was updated successfully, but these errors were encountered: