summaryrefslogtreecommitdiff
path: root/rust/src/types.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-06-16 14:46:48 -0400
committerMason Reed <mason@vector35.com>2025-07-02 01:56:54 -0400
commit00686dfc68ee40b9b7378febadf3c27eb657dff9 (patch)
tree0d54995ab7475486732478dc87cbb306d8a2bc3e /rust/src/types.rs
parent93b524fbf9af52faf13b8647702f61e909b0cdf1 (diff)
[Rust] Remove duplicate `(&str, Variable, &Type)` named variable type impl
Diffstat (limited to 'rust/src/types.rs')
-rw-r--r--rust/src/types.rs32
1 files changed, 2 insertions, 30 deletions
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<Self> {
+ pub unsafe fn ref_from_raw(handle: *mut BNType) -> Ref<Self> {
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,