Cargo fmt more files.

This commit is contained in:
losfair
2019-03-18 00:35:55 +08:00
parent 99faa79869
commit 6c40ea1cb5
5 changed files with 19 additions and 7 deletions

View File

@ -230,7 +230,12 @@ impl LocalBacking {
}
};
elements[init_base + i] = vm::Anyfunc { func, ctx, sig_id, func_index: Some(func_index) };
elements[init_base + i] = vm::Anyfunc {
func,
ctx,
sig_id,
func_index: Some(func_index),
};
}
});
}

View File

@ -1,10 +1,11 @@
use crate::types::{
FuncSig, GlobalDescriptor, MemoryDescriptor, MemoryIndex, TableDescriptor, TableIndex, Type, Value,
FuncSig, GlobalDescriptor, MemoryDescriptor, MemoryIndex, TableDescriptor, TableIndex, Type,
Value,
};
use std::sync::Arc;
use wasmparser::BinaryReaderError;
use core::borrow::Borrow;
use std::any::Any;
use std::sync::Arc;
use wasmparser::BinaryReaderError;
pub type Result<T> = std::result::Result<T, Error>;
pub type CompileResult<T> = std::result::Result<T, CompileError>;

View File

@ -1,5 +1,8 @@
use crate::error::{CompileError, CompileResult};
use crate::{memory::MemoryType, module::ModuleInfo, module::ModuleInner, structures::TypedIndex, units::Pages};
use crate::{
memory::MemoryType, module::ModuleInfo, module::ModuleInner, structures::TypedIndex,
units::Pages,
};
use std::{borrow::Cow, mem};
/// Represents a WebAssembly type.

View File

@ -160,7 +160,7 @@ fn default_compiler() -> &'static dyn Compiler {
#[cfg(not(feature = "llvm"))]
use wasmer_dynasm_backend::SinglePassCompiler as DefaultCompiler;
// use wasmer_clif_backend::CraneliftCompiler as DefaultCompiler; // TODO Fix default
// use wasmer_clif_backend::CraneliftCompiler as DefaultCompiler; // TODO Fix default
lazy_static! {
static ref DEFAULT_COMPILER: DefaultCompiler = { DefaultCompiler::new() };

View File

@ -87,7 +87,10 @@ pub fn run_instance(
if is_emscripten_module(module) {
run_emscripten_instance(module, instance, path, args)?;
} else {
let args: Vec<Value> = args.into_iter().map(|x| Value::I32(x.parse().unwrap())).collect();
let args: Vec<Value> = args
.into_iter()
.map(|x| Value::I32(x.parse().unwrap()))
.collect();
println!("{:?}", instance.call("main", &args)?);
};