remove remains of num feature
commit c41aba6b90 removed the num feature but a few cfgs remained
This commit is contained in:
@@ -545,26 +545,8 @@ impl PartialEq for Number {
|
|||||||
(&Number::Float(n1), Number::Integer(ref n2)) => {
|
(&Number::Float(n1), Number::Integer(ref n2)) => {
|
||||||
n1.eq(&OrderedFloat(n2.to_f64().value()))
|
n1.eq(&OrderedFloat(n2.to_f64().value()))
|
||||||
}
|
}
|
||||||
(Number::Integer(ref n1), Number::Rational(ref n2)) => {
|
(Number::Integer(ref n1), Number::Rational(ref n2)) => n1.num_eq(&**n2),
|
||||||
#[cfg(feature = "num")]
|
(Number::Rational(ref n1), Number::Integer(ref n2)) => n1.num_eq(&**n2),
|
||||||
{
|
|
||||||
&Rational::from(&**n1) == &**n2
|
|
||||||
}
|
|
||||||
#[cfg(not(feature = "num"))]
|
|
||||||
{
|
|
||||||
n1.num_eq(&**n2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(Number::Rational(ref n1), Number::Integer(ref n2)) => {
|
|
||||||
#[cfg(feature = "num")]
|
|
||||||
{
|
|
||||||
n1 == &Rational::from(&**n2)
|
|
||||||
}
|
|
||||||
#[cfg(not(feature = "num"))]
|
|
||||||
{
|
|
||||||
n1.num_eq(&**n2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(Number::Rational(ref n1), &Number::Float(n2)) => {
|
(Number::Rational(ref n1), &Number::Float(n2)) => {
|
||||||
OrderedFloat(n1.to_f64().value()).eq(&n2)
|
OrderedFloat(n1.to_f64().value()).eq(&n2)
|
||||||
}
|
}
|
||||||
@@ -643,24 +625,10 @@ impl Ord for Number {
|
|||||||
n1.cmp(&OrderedFloat(n2.to_f64().value()))
|
n1.cmp(&OrderedFloat(n2.to_f64().value()))
|
||||||
}
|
}
|
||||||
(&Number::Integer(n1), &Number::Rational(n2)) => {
|
(&Number::Integer(n1), &Number::Rational(n2)) => {
|
||||||
#[cfg(feature = "num")]
|
(*n1).num_partial_cmp(&*n2).unwrap_or(Ordering::Less)
|
||||||
{
|
|
||||||
Rational::from(&**n1).cmp(n2)
|
|
||||||
}
|
|
||||||
#[cfg(not(feature = "num"))]
|
|
||||||
{
|
|
||||||
(*n1).num_partial_cmp(&*n2).unwrap_or(Ordering::Less)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
(&Number::Rational(n1), &Number::Integer(n2)) => {
|
(&Number::Rational(n1), &Number::Integer(n2)) => {
|
||||||
#[cfg(feature = "num")]
|
(*n1).num_partial_cmp(&*n2).unwrap_or(Ordering::Less)
|
||||||
{
|
|
||||||
(&**n1).cmp(&Rational::from(&**n2))
|
|
||||||
}
|
|
||||||
#[cfg(not(feature = "num"))]
|
|
||||||
{
|
|
||||||
(*n1).num_partial_cmp(&*n2).unwrap_or(Ordering::Less)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
(&Number::Rational(n1), &Number::Float(n2)) => {
|
(&Number::Rational(n1), &Number::Float(n2)) => {
|
||||||
OrderedFloat(n1.to_f64().value()).cmp(&n2)
|
OrderedFloat(n1.to_f64().value()).cmp(&n2)
|
||||||
|
|||||||
Reference in New Issue
Block a user