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 <alekratz@gmail.com>
This commit is contained in:
2020-09-18 15:39:19 -07:00
parent 0d6f68216b
commit 321fe8e1ea

View File

@@ -1,9 +1,10 @@
use crate::obj::prelude::*;
use shredder::Scan;
use std::fmt::{Debug, Formatter, self};
pub type IntRef = ObjRef<Int>;
#[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()
}
}