diff options
Diffstat (limited to 'common/object/src')
| -rw-r--r-- | common/object/src/json.rs | 3 | ||||
| -rw-r--r-- | common/object/src/value.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/common/object/src/json.rs b/common/object/src/json.rs index cbb8bda..168c0c2 100644 --- a/common/object/src/json.rs +++ b/common/object/src/json.rs @@ -4,7 +4,7 @@ Copyright (C) 2026 metamuffin <metamuffin.org> */ -use crate::{Object, ValueType}; +use crate::{Object, Tag, ValueType}; use serde_json::{Map, Value}; pub fn object_to_json(ob: Object<'_>) -> Value { @@ -18,6 +18,7 @@ pub fn object_to_json(ob: Object<'_>) -> Value { let val = match (ty, sz) { (ValueType::String, _) => ob.get_typed::<&str>(i).unwrap().to_string().into(), (ValueType::Object, _) => object_to_json(ob.get_typed::<Object>(i).unwrap()), + (ValueType::Tag, 4) => ob.get_typed::<Tag>(i).unwrap().to_string().into(), (ValueType::UInt, 4) => ob.get_typed::<u32>(i).unwrap().into(), (ValueType::UInt, 8) => ob.get_typed::<u64>(i).unwrap().into(), (ValueType::Int, 8) => ob.get_typed::<i64>(i).unwrap().into(), diff --git a/common/object/src/value.rs b/common/object/src/value.rs index eb9de7c..01b0903 100644 --- a/common/object/src/value.rs +++ b/common/object/src/value.rs @@ -101,7 +101,7 @@ impl Value<'_> for Tag { } impl ValueStore for Tag { fn get_type(&self) -> ValueType { - ValueType::String + ValueType::Tag } fn store_aligned(&self, buf: &mut Vec<u32>) { buf.push(self.0.to_be()); |