pub(crate) unsafe fn try_partial_cmp(
      &self,
      other: &List,
   ) -> Result<Option<Ordering>, ErrorKind> {
      let (left, right) = (self.as_slice(), other.as_slice());
      let len = left.len().min(right.len());
      let a = &left[..len];
      let b = &right[..len];

      for i in 0..len {
         match a[i].try_partial_cmp(&b[i])? {
            Some(Ordering::Equal) => (),
            non_eq => return Ok(non_eq),
         }
      }

      Ok(left.len().partial_cmp(&right.len()))
   }
/// Attempts to compare two lists to each other lexicographically.
Attempts to compare two lists to each other lexicographically.
Attempts to compare two lists to each other lexicographically .
pub(crate) unsafe fn try_partial_cmp(
      &self,
      other: &List,
   ) -> Result<Option<Ordering>, ErrorKind> {
      let (left, right) = (self.as_slice(), other.as_slice());
      let len = left.len().min(right.len());
      let a = &left[..len];
      let b = &right[..len];
      for i in 0..len {
         match a[i].try_partial_cmp(&b[i])? {
            Some(Ordering::Equal) => (),
            non_eq => return Ok(non_eq),
         }
      }
      Ok(left.len().partial_cmp(&right.len()))
   }
pub ( crate ) unsafe fn try_partial_cmp ( & self , other : & List , ) -> Result < Option < Ordering > , ErrorKind > { let ( left , right ) = ( self . as_slice ( ) , other . as_slice ( ) ) ; let len = left . len ( ) . min ( right . len ( ) ) ; let a = & left [ .. len ] ; let b = & right [ .. len ] ; for i in 0 .. len { match a [ i ] . try_partial_cmp ( & b [ i ] ) ? { Some ( Ordering :: Equal ) => ( ) , non_eq => return Ok ( non_eq ) , } } Ok ( left . len ( ) . partial_cmp ( & right . len ( ) ) ) }
Attempts to compare two lists to each other lexicographically.
Attempts to compare two lists to each other lexicographically .
&self
other
&List