From ea7a22b16fc56c23af397dd690c6c839dfb3a8f1 Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Fri, 3 May 2024 13:28:53 -0300 Subject: hide array implementation details --- rust/src/string.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'rust/src/string.rs') diff --git a/rust/src/string.rs b/rust/src/string.rs index 96830ca5..f4098d66 100644 --- a/rust/src/string.rs +++ b/rust/src/string.rs @@ -164,18 +164,14 @@ impl fmt::Debug for BnString { impl CoreArrayProvider for BnString { type Raw = *mut raw::c_char; type Context = (); + type Wrapped<'a> = &'a str; } -unsafe impl CoreOwnedArrayProvider for BnString { +unsafe impl CoreArrayProviderInner for BnString { unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) { use binaryninjacore_sys::BNFreeStringList; BNFreeStringList(raw, count); } -} - -unsafe impl CoreArrayWrapper for BnString { - type Wrapped<'a> = &'a str; - unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { CStr::from_ptr(*raw).to_str().unwrap() } -- cgit v1.3.1