use crate::integer_vector::{ShortlexIntegerVector, ShortlexIntegerVectorRef};
use core::cmp::Ordering;
impl Ord for ShortlexIntegerVectorRef<'_> {
#[inline]
fn cmp(&self, other: &Self) -> Ordering {
self.0
.elements
.len()
.cmp(&other.0.elements.len())
.then_with(|| self.0.elements.cmp(&other.0.elements))
}
}
impl PartialOrd for ShortlexIntegerVectorRef<'_> {
#[inline]
fn partial_cmp(&self, other: &ShortlexIntegerVectorRef) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for ShortlexIntegerVector {
#[inline]
fn cmp(&self, other: &Self) -> Ordering {
self.as_ref().cmp(&other.as_ref())
}
}
impl PartialOrd for ShortlexIntegerVector {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}