fix example

This commit is contained in:
Pat Hickey
2021-05-06 14:34:30 -07:00
parent b0335d3ddf
commit 3d9b98f1df
3 changed files with 4 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -3135,6 +3135,7 @@ name = "wasi-cap-std-sync"
version = "0.26.0" version = "0.26.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait",
"bitflags", "bitflags",
"cap-fs-ext", "cap-fs-ext",
"cap-rand", "cap-rand",
@@ -3148,7 +3149,6 @@ dependencies = [
"tracing", "tracing",
"unsafe-io", "unsafe-io",
"wasi-common", "wasi-common",
"wiggle",
"winapi", "winapi",
] ]

View File

@@ -13,7 +13,7 @@ include = ["src/**/*", "LICENSE" ]
[dependencies] [dependencies]
wasi-common = { path = "../", version = "0.26.0" } wasi-common = { path = "../", version = "0.26.0" }
async_trait = "0.1" async-trait = "0.1"
anyhow = "1.0" anyhow = "1.0"
cap-std = "0.13.7" cap-std = "0.13.7"
cap-fs-ext = "0.13.7" cap-fs-ext = "0.13.7"

View File

@@ -155,9 +155,8 @@ async fn _run_wasm(inputs: Inputs) -> Result<(), Error> {
// Instantiate // Instantiate
let instance = linker.instantiate_async(&inputs.env.module).await?; let instance = linker.instantiate_async(&inputs.env.module).await?;
instance instance
.get_typed_func("_start") .get_typed_func::<(), ()>("_start")?
.ok_or_else(|| anyhow!("wasm is a wasi command with export _start"))? .call_async(())
.call_async(&[])
.await?; .await?;
Ok(()) Ok(())