diff options
| author | Glenn Smith <glenn@vector35.com> | 2022-08-29 22:43:59 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2022-09-29 21:02:22 -0400 |
| commit | 8cbdc0e05adefd58e6939f7bb70d6f031277e4f6 (patch) | |
| tree | 439ddd7a8eddaca0a54bb980f1ce8b46dc57399d /rust/src/rc.rs | |
| parent | 9fd6ed156fb926c64420c1b38b4e27f0e5c17d0a (diff) | |
[Rust API]: Eq for Ref<Type>
Diffstat (limited to 'rust/src/rc.rs')
| -rw-r--r-- | rust/src/rc.rs | 8 |
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`). |
