summaryrefslogtreecommitdiff
path: root/serde_v8/magic/buffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'serde_v8/magic/buffer.rs')
-rw-r--r--serde_v8/magic/buffer.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/serde_v8/magic/buffer.rs b/serde_v8/magic/buffer.rs
index 3a8c9499b..dfa6928fb 100644
--- a/serde_v8/magic/buffer.rs
+++ b/serde_v8/magic/buffer.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+use std::fmt::Debug;
use std::ops::Deref;
use std::ops::DerefMut;
use std::sync::Mutex;
@@ -21,6 +22,12 @@ pub enum MagicBuffer {
impl_magic!(MagicBuffer);
+impl Debug for MagicBuffer {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_list().entries(self.as_ref().iter()).finish()
+ }
+}
+
impl MagicBuffer {
pub fn empty() -> Self {
MagicBuffer::ToV8(Mutex::new(Some(vec![0_u8; 0].into_boxed_slice())))