diff --git a/lib/middleware-common/src/metering.rs b/lib/middleware-common/src/metering.rs index 436a0d50a..b5dc273f6 100644 --- a/lib/middleware-common/src/metering.rs +++ b/lib/middleware-common/src/metering.rs @@ -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::().is_some()); - }, + } _ => unreachable!(), } diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index 7a2506ac8..966f0f35a 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -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"))]