From 8cbdc0e05adefd58e6939f7bb70d6f031277e4f6 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Mon, 29 Aug 2022 22:43:59 -0400 Subject: [Rust API]: Eq for Ref --- rust/src/types.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'rust/src/types.rs') diff --git a/rust/src/types.rs b/rust/src/types.rs index 746142a5..0a558228 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -579,7 +579,7 @@ impl Drop for TypeBuilder { ////////// // Type -#[derive(PartialEq, Eq, Hash)] +#[derive(Eq, Hash)] pub struct Type { pub(crate) handle: *mut BNType, } @@ -1112,6 +1112,12 @@ impl fmt::Debug for Type { } } +impl PartialEq for Type { + fn eq(&self, other: &Self) -> bool { + unsafe { BNTypesEqual(self.handle, other.handle) } + } +} + unsafe impl Send for Type {} unsafe impl Sync for Type {} @@ -1217,6 +1223,7 @@ impl Variable { //////////////////////// // EnumerationBuilder +#[derive(Debug, Clone)] pub struct EnumerationMember { pub name: BnString, pub value: u64, -- cgit v1.3.1