fn compare_numbers(actual: Value, expected: Value) -> Option<i32> {
    match (actual, expected) {
        (Value::Integer(i1), Value::Integer(i2)) => Some(compare_float(i1 as f64, i2 as f64)),
        (Value::Float(f1), Value::Float(f2)) => Some(compare_float(f1, f2)),
        (Value::Float(f1), Value::Integer(i2)) => Some(compare_float(f1, i2 as f64)),
        (Value::Integer(i1), Value::Float(f2)) => Some(compare_float(i1 as f64, f2)),
        _ => None,
    }
}
// return -1, 0 or 1
// none if one of the value is not a number
1, 0 or 1
none if one of the value is not a number
1 0 or 1 none if one of the value is not a number
fn compare_numbers(actual: Value, expected: Value) -> Option<i32> {
    match (actual, expected) {
        (Value::Integer(i1), Value::Integer(i2)) => Some(compare_float(i1 as f64, i2 as f64)),
        (Value::Float(f1), Value::Float(f2)) => Some(compare_float(f1, f2)),
        (Value::Float(f1), Value::Integer(i2)) => Some(compare_float(f1, i2 as f64)),
        (Value::Integer(i1), Value::Float(f2)) => Some(compare_float(i1 as f64, f2)),
        _ => None,
    }
}
fn compare_numbers ( actual : Value , expected : Value ) -> Option < i32 > { match ( actual , expected ) { ( Value :: Integer ( i1 ) , Value :: Integer ( i2 ) ) => Some ( compare_float ( i1 as f64 , i2 as f64 ) ) , ( Value :: Float ( f1 ) , Value :: Float ( f2 ) ) => Some ( compare_float ( f1 , f2 ) ) , ( Value :: Float ( f1 ) , Value :: Integer ( i2 ) ) => Some ( compare_float ( f1 , i2 as f64 ) ) , ( Value :: Integer ( i1 ) , Value :: Float ( f2 ) ) => Some ( compare_float ( i1 as f64 , f2 ) ) , _ => None , } }
return -1, 0 or 1
none if one of the value is not a number
return - 1 0 or 1 none if one of the value is not a number
actual
Value
expected
Value
actual
Value
expected
Value