From 384789a6bb24bee810684a39bb60b2e1389ec154 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 17 Feb 2026 16:25:05 +0100 Subject: i64 json/debug support --- common/object/src/json.rs | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'common/object/src/json.rs') diff --git a/common/object/src/json.rs b/common/object/src/json.rs index c2ee678..0aa4cbd 100644 --- a/common/object/src/json.rs +++ b/common/object/src/json.rs @@ -21,31 +21,19 @@ pub fn object_to_json(reg: &Registry, ob: Object<'_>) -> Value { }; let key = info.name.to_string(); - match ty { - x if x == STR => { - let val = ob.get_typed::<&str>(i).unwrap().to_string().into(); - multi_insert(&mut o, key, val); - } - x if x == OBJECT => { - let val = object_to_json(reg, ob.get_typed::(i).unwrap()); - multi_insert(&mut o, key, val); - } - x if x == U32 => { - let val = ob.get_typed::(i).unwrap().into(); - multi_insert(&mut o, key, val); - } - x if x == U64 => { - let val = ob.get_typed::(i).unwrap().into(); - multi_insert(&mut o, key, val); - } - x if x == F64 => { - let val = ob.get_typed::(i).unwrap().into(); - multi_insert(&mut o, key, val); - } + let val = match ty { + x if x == STR => ob.get_typed::<&str>(i).unwrap().to_string().into(), + x if x == OBJECT => object_to_json(reg, ob.get_typed::(i).unwrap()), + x if x == U32 => ob.get_typed::(i).unwrap().into(), + x if x == U64 => ob.get_typed::(i).unwrap().into(), + x if x == I64 => ob.get_typed::(i).unwrap().into(), + x if x == F64 => ob.get_typed::(i).unwrap().into(), _ => { nonexhaustive = true; + continue; } }; + multi_insert(&mut o, key, val); } if nonexhaustive { o.insert("_nonexhaustive".to_owned(), Value::Bool(true)); -- cgit v1.3