From f035474090d3c82f50c3860cbafd6f60b8af36e8 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 10 Feb 2026 01:11:36 +0100 Subject: fix index key ser; query debug print --- common/object/src/inspect.rs | 6 +++++- common/object/src/registry.rs | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'common/object') diff --git a/common/object/src/inspect.rs b/common/object/src/inspect.rs index 21648bd..bc217f0 100644 --- a/common/object/src/inspect.rs +++ b/common/object/src/inspect.rs @@ -24,10 +24,14 @@ impl Debug for Inspector<'_, Object<'_>> { }; match ty { x if x == STR => s.field(info.name, &self.1.get_typed::<&str>(i).unwrap()), + x if x == BINARY => s.field(info.name, &self.1.get_typed::<&[u8]>(i).unwrap()), x if x == OBJECT => s.field(info.name, &self.1.get_typed::(i).unwrap()), x if x == U32 => s.field(info.name, &self.1.get_typed::(i).unwrap()), x if x == U64 => s.field(info.name, &self.1.get_typed::(i).unwrap()), - _ => &mut s, + _ => { + nonexhaustive = true; + &mut s + } }; } if nonexhaustive { diff --git a/common/object/src/registry.rs b/common/object/src/registry.rs index d9da2fb..85d3ff2 100644 --- a/common/object/src/registry.rs +++ b/common/object/src/registry.rs @@ -13,11 +13,12 @@ pub mod types { pub const OBJECT: TypeId = TypeId::of::(); pub const STR: TypeId = TypeId::of::<&str>(); + pub const BINARY: TypeId = TypeId::of::<&[u8]>(); pub const U32: TypeId = TypeId::of::(); pub const U64: TypeId = TypeId::of::(); } -#[derive(Default)] +#[derive(Default, Clone)] pub struct Registry { tags: BTreeMap, } @@ -42,6 +43,7 @@ impl Registry { } } +#[derive(Clone)] pub struct TagInfo { pub name: &'static str, pub r#type: Option, -- cgit v1.3