diff options
| author | Henry <mail@henrygressmann.de> | 2026-04-19 17:48:32 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-04-19 17:49:59 +0200 |
| commit | e667ae4554e816b4081d874fc3564b07c28dbec6 (patch) | |
| tree | 534aa3b8b40eb42e77e7f4979d6fc0f3ad320c9e /crates/cli/src/bin.rs | |
| parent | 684d5a04a928ea4132d0c5e61bb4086fac9feb22 (diff) | |
feat: simplify module api
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/cli/src/bin.rs')
| -rw-r--r-- | crates/cli/src/bin.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/cli/src/bin.rs b/crates/cli/src/bin.rs index 5fd50f9..9b283c3 100644 --- a/crates/cli/src/bin.rs +++ b/crates/cli/src/bin.rs @@ -4,7 +4,7 @@ use argh::FromArgs; use args::WasmArg; use eyre::Result; use log::{debug, info}; -use tinywasm::{Module, types::WasmValue}; +use tinywasm::{Module, ModuleInstance, types::WasmValue}; use crate::args::to_wasm_args; mod args; @@ -90,11 +90,11 @@ fn main() -> Result<()> { true => { let wat = std::fs::read_to_string(path)?; let wasm = wat::wat2wasm(&wat); - tinywasm::Module::parse_bytes(&wasm)? + tinywasm::parse_bytes(&wasm)? } #[cfg(not(feature = "wat"))] true => return Err(eyre::eyre!("wat support is not enabled in this build")), - false => tinywasm::Module::parse_file(path)?, + false => tinywasm::parse_file(path)?, }; match engine { @@ -106,7 +106,7 @@ fn main() -> Result<()> { fn run(module: Module, func: Option<String>, args: &[WasmValue]) -> Result<()> { let mut store = tinywasm::Store::default(); - let instance = module.instantiate(&mut store, None)?; + let instance = ModuleInstance::instantiate(&mut store, &module, None)?; if let Some(func) = func { let func = instance.func_untyped(&store, &func)?; |
