mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-05 01:58:58 +03:00
explicitly RocBox arguments when received as box
This commit is contained in:
parent
f966afc23e
commit
acfb8d7562
@ -1,7 +1,7 @@
|
||||
use core::ffi::c_void;
|
||||
use libc;
|
||||
use pulldown_cmark::{html, Options, Parser};
|
||||
use roc_std::RocStr;
|
||||
use roc_std::{RocBox, RocStr};
|
||||
use std::env;
|
||||
use std::ffi::CStr;
|
||||
use std::fs;
|
||||
@ -16,7 +16,7 @@ use syntect::util::LinesWithEndings;
|
||||
|
||||
extern "C" {
|
||||
#[link_name = "roc__transformFileContentForHost_1_exposed"]
|
||||
fn roc_transformFileContentForHost(relPath: &RocStr, content: &RocStr) -> RocStr;
|
||||
fn roc_transformFileContentForHost(relPath: RocBox<RocStr>, content: RocBox<RocStr>) -> RocStr;
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@ -299,8 +299,9 @@ fn process_file(input_dir: &Path, output_dir: &Path, input_file: &Path) -> Resul
|
||||
|
||||
let roc_relpath = RocStr::from(output_relpath.to_str().unwrap());
|
||||
let roc_content_html = RocStr::from(content_html.as_str());
|
||||
let roc_output_str =
|
||||
unsafe { roc_transformFileContentForHost(&roc_relpath, &roc_content_html) };
|
||||
let roc_output_str = unsafe {
|
||||
roc_transformFileContentForHost(RocBox::new(roc_relpath), RocBox::new(roc_content_html))
|
||||
};
|
||||
|
||||
let output_file = output_dir.join(&output_relpath);
|
||||
let rust_output_str: &str = &roc_output_str;
|
||||
|
Loading…
Reference in New Issue
Block a user