From 8580c57c0c6a526c1a2caeb4c2968ed5837d30be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Ver=C5=A1i=C4=87?= Date: Mon, 23 Sep 2024 09:50:03 +0200 Subject: [PATCH] fix(ffi): Add implementation of Niche for `Option>` (#5094) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marin Veršić --- crates/iroha_ffi/src/option.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/iroha_ffi/src/option.rs b/crates/iroha_ffi/src/option.rs index afce6dd5b8..cbac605611 100644 --- a/crates/iroha_ffi/src/option.rs +++ b/crates/iroha_ffi/src/option.rs @@ -1,5 +1,6 @@ //! Logic related to the conversion of [`Option`] to and from FFI-compatible representation +use alloc::boxed::Box; use core::mem::MaybeUninit; use crate::{ @@ -53,6 +54,13 @@ where const NICHE_VALUE: Self::ReprC = core::ptr::null_mut(); } +impl Niche<'_> for Box +where + Self: FfiType, +{ + const NICHE_VALUE: Self::ReprC = core::ptr::null_mut(); +} + impl Ir for Option { type Type = R::Type; }