feat: update example4

This commit is contained in:
2023-01-18 23:48:15 +08:00
parent 8862192778
commit d514f80f64
2 changed files with 1 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ use wasmtime::*;
fn main() -> Result<()> { fn main() -> Result<()> {
// Modules can be compiled through either the text or binary format // Modules can be compiled through either the text or binary format
let engine = Engine::default(); let engine = Engine::default();
let wasm = include_bytes!("/Users/hatterjiang/Code/hattergit/simple-rust-tests/__wasm/wasmtime/wasms/simple_rust_wasm/target/wasm32-unknown-unknown/debug/simple_rust_wasm.wasm"); let wasm = include_bytes!("../wasms/simple_rust_wasm/target/wasm32-unknown-unknown/debug/simple_rust_wasm.wasm");
let module = Module::new(&engine, wasm)?; let module = Module::new(&engine, wasm)?;
// Create a `Linker` which will be later used to instantiate this module. // Create a `Linker` which will be later used to instantiate this module.

View File

@@ -17,6 +17,4 @@ run_example3:
run_example4: run_example4:
cd wasms/simple_rust_wasm; cargo build --target wasm32-unknown-unknown cd wasms/simple_rust_wasm; cargo build --target wasm32-unknown-unknown
cp wasms/simple_rust_wasm/target/wasm32-unknown-unknown/debug/simple_rust_wasm.wasm .
cargo run --example example4 cargo run --example example4
rm simple_rust_wasm.wasm