run_program takes slice now

master
ondra05 2022-06-17 19:35:54 +02:00
parent aeae6e51cf
commit a42c807af5
2 changed files with 3 additions and 3 deletions

View File

@ -238,7 +238,7 @@ pub fn command_parser(user: String, command: String) {
let args = iter.collect::<Vec<&str>>();
println!("{:?}", args);
if in_home || in_shared || in_system {
run_program(binary_prog);
run_program(&binary_prog);
} else {
println!("No such binary: {}", bin_name);
error!("No such binary: {}", bin_name);

View File

@ -100,9 +100,9 @@ pub fn interp() {
}
}
pub fn run_program(program: Vec<u8>) {
pub fn run_program(program: &[u8]) {
// Load wasm binary and prepare it for instantiation.
let module = wasmi::Module::from_buffer(&program).expect("failed to load wasm");
let module = wasmi::Module::from_buffer(program).expect("failed to load wasm");
trace!("Loaded wasm binary");
let imports = ImportsBuilder::new().with_resolver("env", &host_functions::HostExternals {});