Skip to content

Commit

Permalink
added clone of vector fst
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasDepoixSonos committed Jul 22, 2024
1 parent f6469b0 commit af342d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rustfst-ffi/src/fst/const_fst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ pub unsafe extern "C" fn const_fst_display(
///
/// The pointers should be valid.
#[no_mangle]
pub unsafe fn const_fst_from_vec_fst(
pub unsafe extern "C" fn const_fst_from_vec_fst(
vec_fst_prt: *const CFst,
const_fst_ptr: *mut *const CFst,
) -> RUSTFST_FFI_RESULT {
wrap(|| {
let fst = get!(CFst, vec_fst_prt);
let vec_fst = as_fst!(VectorFst<TropicalWeight>, fst);
let const_fst = ConstFst::<TropicalWeight>::from(vec_fst);
let raw_pointer = CFst(const_fst).into_raw_pointer();
let const_fst = ConstFst::from(vec_fst.clone());
let raw_pointer = CFst(Box::new(const_fst)).into_raw_pointer();
unsafe { *const_fst_ptr = raw_pointer };
Ok(())
})
Expand Down

0 comments on commit af342d9

Please sign in to comment.