update to fluence 0.6.2, remove unsafe

This commit is contained in:
boneyard93501 2021-04-29 19:11:44 -05:00
parent e8cf1d87a7
commit 96d9cd42db
2 changed files with 14 additions and 10 deletions

View File

@ -10,6 +10,6 @@ path = "src/main.rs"
name = "curl_adapter"
[dependencies]
fluence = { version = "=0.3.3", features = ["logger"] }
log = "0.4.8"
fluence = { version = "=0.6.2", features = ["logger"] }
log = "0.4.14"
serde_json = "1.0.64"

View File

@ -16,15 +16,19 @@
#![allow(improper_ctypes)]
use fluence::fce;
// use fluence::MountedBinaryStringResult as StringResult;
use fluence::MountedBinaryResult as Result;
use fluence::module_manifest;
use fluence::MountedBinaryResult;
use fluence::WasmLoggerBuilder;
fn main() {}
module_manifest!();
fn main() {
WasmLoggerBuilder::new().build().unwrap();
}
#[fce]
pub fn curl_request(curl_cmd: Vec<String>) -> Result {
let response = unsafe { curl(curl_cmd.clone()) };
log::info!("curl response for {:?} : {:?}", curl_cmd, response);
pub fn curl_request(curl_cmd: Vec<String>) -> MountedBinaryResult {
let response = curl(curl_cmd);
response
}
@ -32,5 +36,5 @@ pub fn curl_request(curl_cmd: Vec<String>) -> Result {
#[fce]
#[link(wasm_import_module = "host")]
extern "C" {
pub fn curl(cmd: Vec<String>) -> Result;
}
pub fn curl(cmd: Vec<String>) -> MountedBinaryResult;
}