Open MOZGIII opened 4 years ago
Both as_object and as_array make sense, would be great to have them.
as_object
as_array
This is what I'm using currently:
pub(super) fn json_as_array(val: &JsonValue) -> Option<&Vec<JsonValue>> { match val { JsonValue::Array(val) => Some(val), _ => None, } } pub(super) fn json_as_object(val: &JsonValue) -> Option<&JsonObject> { match val { JsonValue::Object(val) => Some(val), _ => None, } }
Both
as_object
andas_array
make sense, would be great to have them.This is what I'm using currently: