fix greater than.
This commit is contained in:
parent
03a8328148
commit
731f235d9e
17
src/bin.rs
17
src/bin.rs
@ -250,22 +250,7 @@ impl CompareContextElement for serde_json::Value {
|
|||||||
(
|
(
|
||||||
serde_json::Value::Number(self_num),
|
serde_json::Value::Number(self_num),
|
||||||
OwnedLiteral::LString(other_string),
|
OwnedLiteral::LString(other_string),
|
||||||
) => match (
|
) => return None,
|
||||||
self_num.as_u64(),
|
|
||||||
self_num.as_i64(),
|
|
||||||
self_num.as_f64(),
|
|
||||||
) {
|
|
||||||
(Some(self_uint), _, _) => {
|
|
||||||
return self_uint.to_string().partial_cmp(other_string)
|
|
||||||
}
|
|
||||||
(_, Some(self_int), _) => {
|
|
||||||
return self_int.to_string().partial_cmp(other_string)
|
|
||||||
}
|
|
||||||
(_, _, Some(self_float)) => {
|
|
||||||
return self_float.to_string().partial_cmp(other_string)
|
|
||||||
}
|
|
||||||
(None, None, None) => panic!("This should be impossible since u64 and i64 can both be converted to floats")
|
|
||||||
}
|
|
||||||
(
|
(
|
||||||
serde_json::Value::Number(self_num),
|
serde_json::Value::Number(self_num),
|
||||||
OwnedLiteral::LPositiveInteger(other_num),
|
OwnedLiteral::LPositiveInteger(other_num),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user