From 642d32f688d735decccf2b844d113c436982f5e0 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Wed, 29 Jun 2022 17:28:31 -0400 Subject: [Rust API] Make more types convertible to BN types --- rust/src/rc.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'rust/src/rc.rs') diff --git a/rust/src/rc.rs b/rust/src/rc.rs index f8507d0c..b21b7b94 100644 --- a/rust/src/rc.rs +++ b/rust/src/rc.rs @@ -15,6 +15,7 @@ //! Reference counting for core Binary Ninja objects. use std::borrow::Borrow; +use std::fmt::{Debug, Display, Formatter}; use std::marker::PhantomData; use std::mem; use std::ops::{Deref, DerefMut}; @@ -99,6 +100,18 @@ impl Clone for Ref { } } +impl Display for Ref { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + self.contents.fmt(f) + } +} + +impl Debug for Ref { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + self.contents.fmt(f) + } +} + // Guard provides access to a core-allocated resource whose // reference is held indirectly (e.g. a core-allocated array // of raw `*mut BNRawT`). -- cgit v1.3.1