mirror of
https://github.com/fluencelabs/examples
synced 2024-12-04 19:20:17 +00:00
update to fluence 0.6.2, remove unsafe
This commit is contained in:
parent
e8cf1d87a7
commit
96d9cd42db
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user