aboutsummaryrefslogtreecommitdiff
path: root/common/object/src/debug.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-27 20:56:20 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-27 20:56:20 +0100
commit7930d543a2aa68d4ad2958605827d7eb1baa91f8 (patch)
treefe59d1f549e303a96b78d3e925d75abb70b73af0 /common/object/src/debug.rs
parentc05bfcc2775f0e11db6e856bfcf06d0419c35d54 (diff)
downloadjellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar
jellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar.bz2
jellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar.zst
reimplement Object as slice type
Diffstat (limited to 'common/object/src/debug.rs')
-rw-r--r--common/object/src/debug.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/common/object/src/debug.rs b/common/object/src/debug.rs
index b45d5bf..196da20 100644
--- a/common/object/src/debug.rs
+++ b/common/object/src/debug.rs
@@ -4,16 +4,10 @@
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
-use crate::{Object, ObjectBuffer, Tag, TypedTag, ValueType};
+use crate::{Object, Tag, TypedTag, ValueType};
use std::{any::type_name, fmt::Debug};
-impl Debug for ObjectBuffer {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- self.as_object().fmt(f)
- }
-}
-
-impl Debug for Object<'_> {
+impl Debug for Object {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut s = f.debug_struct("Object");
let mut nonexhaustive = false;
@@ -23,8 +17,8 @@ impl Debug for Object<'_> {
let ty = self.offset_type(i);
let sz = self.size(i);
match (ty, sz) {
- (ValueType::String, _) => s.field(k, &self.get_typed::<&str>(i).unwrap()),
- (ValueType::Binary, _) => s.field(k, &self.get_typed::<&[u8]>(i).unwrap()),
+ (ValueType::String, _) => s.field(k, &self.get_typed::<str>(i).unwrap()),
+ (ValueType::Binary, _) => s.field(k, &self.get_typed::<[u8]>(i).unwrap()),
(ValueType::Object, _) => s.field(k, &self.get_typed::<Object>(i).unwrap()),
(ValueType::UInt, 4) => s.field(k, &self.get_typed::<u32>(i).unwrap()),
(ValueType::UInt, 8) => s.field(k, &self.get_typed::<u64>(i).unwrap()),