Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Impl more PartialEq and PartialOrd.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidli2010 committed Aug 28, 2020
1 parent bc438ff commit 7f69c19
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,34 @@ impl PartialEq<NumericBuf> for &Numeric {
}
}

impl PartialEq<Numeric> for &Numeric {
#[inline]
fn eq(&self, other: &Numeric) -> bool {
(*self).eq(other)
}
}

impl PartialEq<&Numeric> for Numeric {
#[inline]
fn eq(&self, other: &&Numeric) -> bool {
self.eq(*other)
}
}

impl PartialEq<NumericBuf> for &NumericBuf {
#[inline]
fn eq(&self, other: &NumericBuf) -> bool {
(*self).eq(other)
}
}

impl PartialEq<&NumericBuf> for NumericBuf {
#[inline]
fn eq(&self, other: &&NumericBuf) -> bool {
self.eq(*other)
}
}

impl PartialOrd<Numeric> for NumericBuf {
#[inline]
fn partial_cmp(&self, other: &Numeric) -> Option<Ordering> {
Expand Down Expand Up @@ -732,6 +760,34 @@ impl PartialOrd<NumericBuf> for &Numeric {
}
}

impl PartialOrd<Numeric> for &Numeric {
#[inline]
fn partial_cmp(&self, other: &Numeric) -> Option<Ordering> {
(*self).partial_cmp(other)
}
}

impl PartialOrd<&Numeric> for Numeric {
#[inline]
fn partial_cmp(&self, other: &&Numeric) -> Option<Ordering> {
self.partial_cmp(*other)
}
}

impl PartialOrd<NumericBuf> for &NumericBuf {
#[inline]
fn partial_cmp(&self, other: &NumericBuf) -> Option<Ordering> {
(*self).partial_cmp(other)
}
}

impl PartialOrd<&NumericBuf> for NumericBuf {
#[inline]
fn partial_cmp(&self, other: &&NumericBuf) -> Option<Ordering> {
self.partial_cmp(*other)
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 7f69c19

Please sign in to comment.