jsonlogic 0.1.2

A JsonLogic implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde_json::Value;

use super::logic;

pub fn compute(args: &[Value]) -> Value {
    let a = match args.get(0) {
        Some(arg) => arg,
        None => return Value::Bool(false),
    };

    let b = match args.get(1) {
        Some(arg) => arg,
        None => return Value::Bool(false),
    };

    Value::Bool(logic::greater_equal_than(a, b))
}