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

View File

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