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/debuginfo.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'rust/src/debuginfo.rs') diff --git a/rust/src/debuginfo.rs b/rust/src/debuginfo.rs index 2b3a2cd0..054e15cd 100644 --- a/rust/src/debuginfo.rs +++ b/rust/src/debuginfo.rs @@ -273,12 +273,16 @@ impl ToOwned for DebugInfoParser { impl CoreArrayProvider for DebugInfoParser { type Raw = *mut BNDebugInfoParser; type Context = (); + type Wrapped<'a> = Guard<'a, DebugInfoParser>; } -unsafe impl CoreOwnedArrayProvider for DebugInfoParser { +unsafe impl CoreArrayProviderInner for DebugInfoParser { unsafe fn free(raw: *mut Self::Raw, count: usize, _: &Self::Context) { BNFreeDebugInfoParserList(raw, count); } + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, context: &'a Self::Context) -> Self::Wrapped<'a> { + Guard::new(Self { handle: *raw }, context) + } } unsafe impl CoreArrayWrapper for DebugInfoParser { -- cgit v1.3.1