Skip to content

Commit

Permalink
Less-than is asymmetric, not antisymmetric
Browse files Browse the repository at this point in the history
This has bothered me for a while. It's such a small nit, but...
  • Loading branch information
taralx committed Dec 30, 2019
1 parent 9d6f871 commit d935a26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/cmp.rs
Expand Up @@ -495,7 +495,7 @@ impl<T: Ord> Ord for Reverse<T> {
///
/// An order is a total order if it is (for all `a`, `b` and `c`):
///
/// - total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is true; and
/// - total and asymmetric: exactly one of `a < b`, `a == b` or `a > b` is true; and
/// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
///
/// ## Derivable
Expand Down Expand Up @@ -674,7 +674,7 @@ impl PartialOrd for Ordering {
///
/// The comparison must satisfy, for all `a`, `b` and `c`:
///
/// - antisymmetry: if `a < b` then `!(a > b)`, as well as `a > b` implying `!(a < b)`; and
/// - asymmetry: if `a < b` then `!(a > b)`, as well as `a > b` implying `!(a < b)`; and
/// - transitivity: `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
///
/// Note that these requirements mean that the trait itself must be implemented symmetrically and
Expand Down

0 comments on commit d935a26

Please sign in to comment.