From 00686dfc68ee40b9b7378febadf3c27eb657dff9 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 16 Jun 2025 14:46:48 -0400 Subject: [Rust] Remove duplicate `(&str, Variable, &Type)` named variable type impl --- rust/src/types.rs | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'rust/src/types.rs') diff --git a/rust/src/types.rs b/rust/src/types.rs index 03e2fc2c..ebc4328e 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -444,12 +444,12 @@ pub struct Type { /// bv.define_user_type("int_2", &my_custom_type_2); /// ``` impl Type { - pub(crate) unsafe fn from_raw(handle: *mut BNType) -> Self { + pub unsafe fn from_raw(handle: *mut BNType) -> Self { debug_assert!(!handle.is_null()); Self { handle } } - pub(crate) unsafe fn ref_from_raw(handle: *mut BNType) -> Ref { + pub unsafe fn ref_from_raw(handle: *mut BNType) -> Ref { debug_assert!(!handle.is_null()); Ref::new(Self { handle }) } @@ -1092,34 +1092,6 @@ impl FunctionParameter { } } -// TODO: We need to delete this... -// Name, Variable and Type -impl CoreArrayProvider for (&str, Variable, &Type) { - type Raw = BNVariableNameAndType; - type Context = (); - type Wrapped<'a> - = (&'a str, Variable, &'a Type) - where - Self: 'a; -} - -// TODO: This needs to go! -unsafe impl CoreArrayProviderInner for (&str, Variable, &Type) { - unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) { - BNFreeVariableNameAndTypeList(raw, count) - } - - unsafe fn wrap_raw<'a>( - raw: &'a Self::Raw, - _context: &'a Self::Context, - ) -> (&'a str, Variable, &'a Type) { - let name = CStr::from_ptr(raw.name).to_str().unwrap(); - let var = Variable::from(raw.var); - let var_type = &*(raw.type_ as *mut Type); - (name, var, var_type) - } -} - #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct EnumerationMember { pub name: String, -- cgit v1.3.1