Cargo fmt

This commit is contained in:
losfair
2019-06-05 11:52:25 +08:00
parent f2d8aad73a
commit f5243aff5e
2 changed files with 4 additions and 6 deletions

View File

@ -95,10 +95,8 @@ impl FunctionMiddleware for Metering {
ty: WpType::EmptyBlockType,
}));
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new(
move |ctx| {
unsafe {
(ctx.throw)(Box::new(ExecutionLimitExceededError));
}
move |ctx| unsafe {
(ctx.throw)(Box::new(ExecutionLimitExceededError));
},
))));
sink.push(Event::WasmOwned(Operator::End));
@ -272,7 +270,7 @@ mod tests {
match err {
RuntimeError::Error { data } => {
assert!(data.downcast_ref::<ExecutionLimitExceededError>().is_some());
},
}
_ => unreachable!(),
}

View File

@ -17,6 +17,7 @@ use wasmer::*;
use wasmer_clif_backend::CraneliftCompiler;
#[cfg(feature = "backend:llvm")]
use wasmer_llvm_backend::code::LLVMModuleCodeGenerator;
use wasmer_middleware_common::metering::Metering;
use wasmer_runtime::{
cache::{Cache as BaseCache, FileSystemCache, WasmHash, WASMER_VERSION_HASH},
error::RuntimeError,
@ -33,7 +34,6 @@ use wasmer_runtime_core::{
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
#[cfg(feature = "wasi")]
use wasmer_wasi;
use wasmer_middleware_common::metering::Metering;
// stub module to make conditional compilation happy
#[cfg(not(feature = "wasi"))]