diff --git a/crates/oxi-types/src/dictionary.rs b/crates/oxi-types/src/dictionary.rs index e2506112..d558b894 100644 --- a/crates/oxi-types/src/dictionary.rs +++ b/crates/oxi-types/src/dictionary.rs @@ -23,7 +23,21 @@ pub(super) struct KeyValuePair { impl core::fmt::Debug for Dictionary { #[inline] fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { - f.debug_map().entries(self.iter()).finish() + write!(f, "{{ ")?; + + let num_elements = self.len(); + + for (idx, (key, value)) in self.iter().enumerate() { + write!(f, "{}: {:?}", key, value)?; + + if idx + 1 < num_elements { + write!(f, ", ")?; + } + } + + write!(f, " }}")?; + + Ok(()) } } diff --git a/crates/oxi-types/src/object.rs b/crates/oxi-types/src/object.rs index 4db7fe00..b224fc12 100644 --- a/crates/oxi-types/src/object.rs +++ b/crates/oxi-types/src/object.rs @@ -109,7 +109,7 @@ impl core::fmt::Debug for Object { }, }; - f.debug_tuple("Object").field(field).finish() + field.fmt(f) } } diff --git a/crates/oxi-types/src/string.rs b/crates/oxi-types/src/string.rs index 5e1c7aee..c02e7b7b 100644 --- a/crates/oxi-types/src/string.rs +++ b/crates/oxi-types/src/string.rs @@ -30,7 +30,14 @@ impl Default for String { impl core::fmt::Debug for String { #[inline] fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - f.write_str(self.to_string_lossy().as_ref()) + self.to_string_lossy().as_ref().fmt(f) + } +} + +impl core::fmt::Display for String { + #[inline] + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + self.to_string_lossy().as_ref().fmt(f) } }