Skip to content

Commit

Permalink
fix(ffi): Add implementation of Niche for Option<Box<R>> (#5094)
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed Sep 23, 2024
1 parent c3d09ab commit 8580c57
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/iroha_ffi/src/option.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Logic related to the conversion of [`Option<T>`] to and from FFI-compatible representation

use alloc::boxed::Box;
use core::mem::MaybeUninit;

use crate::{
Expand Down Expand Up @@ -53,6 +54,13 @@ where
const NICHE_VALUE: Self::ReprC = core::ptr::null_mut();
}

impl<R, C> Niche<'_> for Box<R>
where
Self: FfiType<ReprC = *mut C>,
{
const NICHE_VALUE: Self::ReprC = core::ptr::null_mut();
}

impl<R: OptionIr> Ir for Option<R> {
type Type = R::Type;
}
Expand Down

0 comments on commit 8580c57

Please sign in to comment.