From a67d3bdfe0e5fd15e64191282a2c5545df6123d8 Mon Sep 17 00:00:00 2001 From: Lukas Bergdoll Date: Sun, 29 Sep 2024 09:32:03 +0200 Subject: [PATCH] Remove duplicate section --- library/core/src/cmp.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 7a3f40fdf1ed9..4377b4993b8f7 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -775,19 +775,7 @@ impl Clone for Reverse { /// /// ## How can I implement `Ord`? /// -/// `Ord` requires that the type also be [`PartialOrd`], [`PartialEq`] and [`Eq`]. -/// -/// If you manually implement `Ord`, you should also implement [`PartialOrd`]. It is a logic error -/// to have [`PartialOrd`] and `Ord` disagree, so it is best to have the logic in `Ord` and -/// implement [`PartialOrd`] as `Some(self.cmp(other))`. -/// -/// Conceptually [`PartialOrd`] and `Ord` form a similar relationship to [`PartialEq`] and [`Eq`]. -/// [`PartialEq`] defines an equality relationship between types, and [`Eq`] defines an additional -/// property on top of the properties implied by [`PartialEq`], namely reflexivity. In a similar -/// fashion `Ord` builds on top of [`PartialOrd`] and adds further properties, such as totality, -/// which means all values must be comparable. -/// -/// `Ord` requires that the type also be PartialOrd, PartialEq, and Eq. +/// `Ord` requires that the type also be [`PartialOrd`], [`PartialEq`], and [`Eq`]. /// /// Because `Ord` implies a stronger ordering relationship than [`PartialOrd`], and both `Ord` and /// [`PartialOrd`] must agree, you must choose how to implement `Ord` **first**. You can choose to