Macro value
Source macro_rules! value {
($matcher:expr) => { ... };
}
👎Deprecated since 0.2.0: please use json::primitive! instead
Expand description
Matches a JSON string, number, or boolean against the given matcher.
§Examples
let data = j!({"active": true, "count": 3});
verify_that!(data["active"], json::value!(eq(true)));
verify_that!(data["count"], json::value!(ge(0)));
§Errors
Fails when the JSON value is not a string, number, or boolean.