diff options
| author | Rubens Brandao <git@rubens.io> | 2024-05-03 13:28:53 -0300 |
|---|---|---|
| committer | Kyle Martin <krm504@nyu.edu> | 2024-05-10 12:00:27 -0400 |
| commit | ea7a22b16fc56c23af397dd690c6c839dfb3a8f1 (patch) | |
| tree | 45f3ba19172017694388ab6f7266e23df76bb670 /rust/src/function.rs | |
| parent | 015314d34d073a8ebbd958edf8150a81381f12c2 (diff) | |
hide array implementation details
Diffstat (limited to 'rust/src/function.rs')
| -rw-r--r-- | rust/src/function.rs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/rust/src/function.rs b/rust/src/function.rs index 74e05ea5..f57d2fe3 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -414,17 +414,13 @@ unsafe impl RefCountable for Function { impl CoreArrayProvider for Function { type Raw = *mut BNFunction; type Context = (); + type Wrapped<'a> = Guard<'a, Function>; } -unsafe impl CoreOwnedArrayProvider for Function { +unsafe impl CoreArrayProviderInner for Function { unsafe fn free(raw: *mut *mut BNFunction, count: usize, _context: &()) { BNFreeFunctionList(raw, count); } -} - -unsafe impl CoreArrayWrapper for Function { - type Wrapped<'a> = Guard<'a, Function>; - unsafe fn wrap_raw<'a>(raw: &'a *mut BNFunction, context: &'a ()) -> Self::Wrapped<'a> { Guard::new(Function { handle: *raw }, context) } @@ -469,16 +465,12 @@ impl AddressRange { impl CoreArrayProvider for AddressRange { type Raw = BNAddressRange; type Context = (); + type Wrapped<'a> = &'a AddressRange; } -unsafe impl CoreOwnedArrayProvider for AddressRange { +unsafe impl CoreArrayProviderInner for AddressRange { unsafe fn free(raw: *mut Self::Raw, _count: usize, _context: &Self::Context) { BNFreeAddressRanges(raw); } -} - -unsafe impl CoreArrayWrapper for AddressRange { - type Wrapped<'a> = &'a AddressRange; - unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { mem::transmute(raw) } |
