fastnum/decimal/dec/impls/ord.rs
1use core::cmp::Ordering;
2
3use crate::decimal::Decimal;
4
5impl<const N: usize> PartialOrd for Decimal<N> {
6 #[inline(always)]
7 fn partial_cmp(&self, rhs: &Self) -> Option<Ordering> {
8 Some(core::cmp::Ord::cmp(self, rhs))
9 }
10}
11
12impl<const N: usize> Ord for Decimal<N> {
13 #[inline(always)]
14 fn cmp(&self, rhs: &Self) -> Ordering {
15 self.cmp(rhs)
16 }
17}