Improved wasmer invoke based on feedback

This commit is contained in:
Syrus 2019-11-15 10:41:18 -08:00
parent be1f192df2
commit f3b7c6b321

View File

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