summaryrefslogtreecommitdiff
path: root/rust/src/rc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/rc.rs')
-rw-r--r--rust/src/rc.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/src/rc.rs b/rust/src/rc.rs
index a65403e2..ad9d9e35 100644
--- a/rust/src/rc.rs
+++ b/rust/src/rc.rs
@@ -112,6 +112,14 @@ impl<T: RefCountable + Debug> Debug for Ref<T> {
}
}
+impl<T: RefCountable + PartialEq> PartialEq for Ref<T> {
+ fn eq(&self, other: &Self) -> bool {
+ self.contents.eq(&other.contents)
+ }
+}
+
+impl<T: RefCountable + PartialEq> Eq for Ref<T> {}
+
// Guard provides access to a core-allocated resource whose
// reference is held indirectly (e.g. a core-allocated array
// of raw `*mut BNRawT`).