Complete PartialOrd implementation
PartialOrd partialness requires all methods to be overridden to provide consistent quirkyness with floats.
This commit is contained in:
+21
@@ -644,9 +644,30 @@ impl<A: Array> Default for ArrayVec<A> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<A: Array> PartialOrd for ArrayVec<A> where A::Item: PartialOrd {
|
impl<A: Array> PartialOrd for ArrayVec<A> where A::Item: PartialOrd {
|
||||||
|
#[inline]
|
||||||
fn partial_cmp(&self, other: &ArrayVec<A>) -> Option<cmp::Ordering> {
|
fn partial_cmp(&self, other: &ArrayVec<A>) -> Option<cmp::Ordering> {
|
||||||
(**self).partial_cmp(other)
|
(**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<A: Array> Ord for ArrayVec<A> where A::Item: Ord {
|
impl<A: Array> Ord for ArrayVec<A> where A::Item: Ord {
|
||||||
|
|||||||
Reference in New Issue
Block a user