From c3f2866bd398425845d4045a70aace13fd40cbc7 Mon Sep 17 00:00:00 2001 From: bluss Date: Thu, 10 Sep 2015 15:13:26 +0200 Subject: [PATCH] Complete PartialOrd implementation PartialOrd partialness requires all methods to be overridden to provide consistent quirkyness with floats. --- src/lib.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index d739832..9e3d1d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -644,9 +644,30 @@ impl Default for ArrayVec { } impl PartialOrd for ArrayVec where A::Item: PartialOrd { + #[inline] fn partial_cmp(&self, other: &ArrayVec) -> Option { (**self).partial_cmp(other) } + + #[inline] + fn lt(&self, other: &Self) -> bool { + (**self).lt(other) + } + + #[inline] + fn le(&self, other: &Self) -> bool { + (**self).le(other) + } + + #[inline] + fn ge(&self, other: &Self) -> bool { + (**self).ge(other) + } + + #[inline] + fn gt(&self, other: &Self) -> bool { + (**self).gt(other) + } } impl Ord for ArrayVec where A::Item: Ord {