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:
@@ -1,9 +1,10 @@
|
|||||||
use crate::obj::prelude::*;
|
use crate::obj::prelude::*;
|
||||||
use shredder::Scan;
|
use shredder::Scan;
|
||||||
|
use std::fmt::{Debug, Formatter, self};
|
||||||
|
|
||||||
pub type IntRef = ObjRef<Int>;
|
pub type IntRef = ObjRef<Int>;
|
||||||
|
|
||||||
#[derive(Debug, Scan)]
|
#[derive(Scan)]
|
||||||
pub struct Int {
|
pub struct Int {
|
||||||
value: i64,
|
value: i64,
|
||||||
vtable: Vtable,
|
vtable: Vtable,
|
||||||
@@ -28,3 +29,11 @@ impl Int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl_obj_readonly!(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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user