Skip to content

Commit

Permalink
Implement ToOCaml<T> for BoxRoot<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
tizoc committed May 18, 2021
1 parent 3682d84 commit 8abba3d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/conv/to_ocaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ unsafe impl<'root, T> ToOCaml<T> for OCamlRef<'root, T> {
}
}

unsafe impl<T> ToOCaml<T> for BoxRoot<T> {
fn to_ocaml<'a>(&self, cr: &'a mut OCamlRuntime) -> OCaml<'a, T> {
self.get(cr)
}
}

unsafe impl ToOCaml<()> for () {
fn to_ocaml(&self, _cr: &mut OCamlRuntime) -> OCaml<'static, ()> {
OCaml::unit()
Expand Down

0 comments on commit 8abba3d

Please sign in to comment.