Fixed middleware linting

This commit is contained in:
Syrus
2019-07-31 21:24:46 -07:00
parent 5e7a20ef94
commit a83b6eccfa

View File

@ -134,24 +134,22 @@ mod tests {
use super::*; use super::*;
use wabt::wat2wasm; use wabt::wat2wasm;
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func}; use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func};
#[cfg(feature = "llvm")] #[cfg(feature = "llvm")]
fn get_compiler(limit: u64) -> impl Compiler { fn get_compiler(limit: u64) -> impl Compiler {
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
use wasmer_llvm_backend::ModuleCodeGenerator as LLVMMCG; use wasmer_llvm_backend::ModuleCodeGenerator as LLVMMCG;
let c: StreamingCompiler<LLVMMCG, _, _, _, _> = let c: StreamingCompiler<LLVMMCG, _, _, _, _> = StreamingCompiler::new(move || {
StreamingCompiler::new(move || { let mut chain = MiddlewareChain::new();
let mut chain = MiddlewareChain::new(); chain.push(Metering::new(limit));
chain.push(Metering::new(limit)); chain
chain });
});
c c
} }
#[cfg(feature = "singlepass")] #[cfg(feature = "singlepass")]
fn get_compiler(limit: u64) -> impl Compiler { fn get_compiler(limit: u64) -> impl Compiler {
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG; use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
let c: StreamingCompiler<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || { let c: StreamingCompiler<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new(); let mut chain = MiddlewareChain::new();