Compare two optional JSON values (for scan_filter compatibility).
(
a: Option<&serde_json::Value>,
b: Option<&serde_json::Value>,
)
| 39 | |
| 40 | /// Compare two optional JSON values (for scan_filter compatibility). |
| 41 | pub fn compare_json_optional( |
| 42 | a: Option<&serde_json::Value>, |
| 43 | b: Option<&serde_json::Value>, |
| 44 | ) -> Ordering { |
| 45 | match (a, b) { |
| 46 | (None, None) => Ordering::Equal, |
| 47 | (None, Some(_)) => Ordering::Less, |
| 48 | (Some(_), None) => Ordering::Greater, |
| 49 | (Some(a), Some(b)) => compare_json(a, b), |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /// Check equality with type coercion. |
| 54 | /// |
no test coverage detected