diff options
Diffstat (limited to 'rust/src/rc.rs')
| -rw-r--r-- | rust/src/rc.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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<T: RefCountable> Clone for Ref<T> { } } +impl<T: RefCountable + Display> Display for Ref<T> { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + self.contents.fmt(f) + } +} + +impl<T: RefCountable + Debug> Debug for Ref<T> { + 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`). |
