From f3c1a3cb3cbdd25d5f556d1ab770f8cbc29fd567 Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Tue, 16 Apr 2024 17:03:20 -0300 Subject: add guard to array with unbound return types --- rust/src/custombinaryview.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'rust/src/custombinaryview.rs') diff --git a/rust/src/custombinaryview.rs b/rust/src/custombinaryview.rs index c69bad39..898102d6 100644 --- a/rust/src/custombinaryview.rs +++ b/rust/src/custombinaryview.rs @@ -298,12 +298,10 @@ unsafe impl CoreOwnedArrayProvider for BinaryViewType { } unsafe impl CoreArrayWrapper for BinaryViewType { - // TODO there is nothing blocking the returned value from out-living the - // array, change it to &_ or Guard? - type Wrapped<'a> = BinaryViewType; + type Wrapped<'a> = Guard<'a, BinaryViewType>; unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { - BinaryViewType(*raw) + Guard::new(BinaryViewType(*raw), &()) } } -- cgit v1.3.1