diff --git a/Cargo.toml b/Cargo.toml index df9a44b..edfd833 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "bytedata" version = "0.1.7" edition = "2021" -rust-version = "1.75.0" +rust-version = "1.75" description = "Representation of a byte slice that is either static, borrowed, or shared." license = "MIT OR LGPL-3.0-or-later" repository = "https://github.com/TimLuq/bytedata/" diff --git a/src/byte_chunk.rs b/src/byte_chunk.rs index 779cee9..4a1ac76 100644 --- a/src/byte_chunk.rs +++ b/src/byte_chunk.rs @@ -159,3 +159,10 @@ impl Default for ByteChunk { unsafe { core::mem::zeroed() } } } + +impl core::fmt::Debug for ByteChunk { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + let rend = crate::ByteStringRender::from_slice(self.as_slice()); + core::fmt::Debug::fmt(&rend, f) + } +} diff --git a/src/external.rs b/src/external.rs index 5c1066b..552d264 100644 --- a/src/external.rs +++ b/src/external.rs @@ -149,7 +149,8 @@ impl ExtBytes { (header, len, ptr) }; - let data = alloc::boxed::Box::into_raw(alloc::boxed::Box::new(ExtBytesRef { data, ptr, len })); + let data = + alloc::boxed::Box::into_raw(alloc::boxed::Box::new(ExtBytesRef { data, ptr, len })); crate::ByteData { external: core::mem::ManuallyDrop::new(ExtBytes {