Skip to content

Commit

Permalink
Remove duplicate section
Browse files Browse the repository at this point in the history
  • Loading branch information
Voultapher committed Sep 29, 2024
1 parent d17ba5d commit a67d3bd
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions library/core/src/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,19 +775,7 @@ impl<T: Clone> Clone for Reverse<T> {
///
/// ## 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
Expand Down

0 comments on commit a67d3bd

Please sign in to comment.