From 321fe8e1eac5aa071706cc1c50b30f2027056da3 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Fri, 18 Sep 2020 15:39:19 -0700 Subject: [PATCH] Add custom debug impl for obj::int::Int This removes the vtable and attrs members from appearing, which muddies up what we really care about with ints Signed-off-by: Alek Ratzloff --- src/obj/int.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/obj/int.rs b/src/obj/int.rs index a6ffbf5..cc66a64 100644 --- a/src/obj/int.rs +++ b/src/obj/int.rs @@ -1,9 +1,10 @@ use crate::obj::prelude::*; use shredder::Scan; +use std::fmt::{Debug, Formatter, self}; pub type IntRef = ObjRef; -#[derive(Debug, Scan)] +#[derive(Scan)] pub struct Int { value: i64, vtable: Vtable, @@ -28,3 +29,11 @@ impl Int { } impl_obj_readonly!(Int); + +impl Debug for Int { + fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { + fmt.debug_struct("Int") + .field("value", &self.value) + .finish() + } +}