File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -668,7 +668,7 @@ impl<T: Clone> Clone for Reverse<T> {
668668/// Here's an example:
669669///
670670/// ```
671- /// #[derive(PartialEq, PartialOrd)]
671+ /// #[derive(PartialEq, Eq, PartialOrd, Ord )]
672672/// enum Size {
673673/// Small,
674674/// Large,
@@ -898,6 +898,18 @@ impl PartialOrd for Ordering {
898898/// This trait can be used with `#[derive]`. When `derive`d on structs, it will produce a
899899/// lexicographic ordering based on the top-to-bottom declaration order of the struct's members.
900900/// When `derive`d on enums, variants are ordered by their top-to-bottom discriminant order.
901+ /// This means variants at the top are less than variants at the bottom.
902+ /// Here's an example:
903+ ///
904+ /// ```
905+ /// #[derive(PartialEq, PartialOrd)]
906+ /// enum Size {
907+ /// Small,
908+ /// Large,
909+ /// }
910+ ///
911+ /// assert!(Size::Small < Size::Large);
912+ /// ```
901913///
902914/// ## How can I implement `PartialOrd`?
903915///
@@ -970,8 +982,8 @@ impl PartialOrd for Ordering {
970982/// # Examples
971983///
972984/// ```
973- /// let x : u32 = 0;
974- /// let y : u32 = 1;
985+ /// let x: u32 = 0;
986+ /// let y: u32 = 1;
975987///
976988/// assert_eq!(x < y, true);
977989/// assert_eq!(x.lt(&y), true);
You can’t perform that action at this time.
0 commit comments