Revert "Improved wasmer invoke based on feedback"

This reverts commit f3b7c6b321.
This commit is contained in:
Syrus 2019-11-15 14:04:48 -08:00
parent f3b7c6b321
commit 3d3636059a

View File

@ -687,7 +687,10 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
args.push(Value::I32(x));
}
let invoke_fn = options.invoke.clone().unwrap_or("main".to_owned());
let invoke_fn = match options.invoke.as_ref() {
Some(fun) => fun,
_ => "main",
};
instance
.dyn_func(&invoke_fn)
.map_err(|e| format!("{:?}", e))?