[clippy] Remove unnecessary closures;
This commit is contained in:
committed by
Dan Gohman
parent
b616644495
commit
0ad7dbf689
@@ -137,14 +137,14 @@ fn parse_local_decls(
|
||||
let mut next_local = num_params;
|
||||
let local_count = reader
|
||||
.read_local_count()
|
||||
.map_err(|e| WasmError::from_binary_reader_error(e))?;
|
||||
.map_err(WasmError::from_binary_reader_error)?;
|
||||
|
||||
let mut locals_total = 0;
|
||||
for _ in 0..local_count {
|
||||
builder.set_srcloc(cur_srcloc(reader));
|
||||
let (count, ty) = reader
|
||||
.read_local_decl(&mut locals_total)
|
||||
.map_err(|e| WasmError::from_binary_reader_error(e))?;
|
||||
.map_err(WasmError::from_binary_reader_error)?;
|
||||
declare_locals(builder, count, ty, &mut next_local);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ fn parse_function_body<FE: FuncEnvironment + ?Sized>(
|
||||
builder.set_srcloc(cur_srcloc(&reader));
|
||||
let op = reader
|
||||
.read_operator()
|
||||
.map_err(|e| WasmError::from_binary_reader_error(e))?;
|
||||
.map_err(WasmError::from_binary_reader_error)?;
|
||||
translate_operator(op, builder, state, environ)?;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ pub fn translate_module<'data>(
|
||||
let size = reader.bytes_remaining();
|
||||
environ.define_function_body(reader
|
||||
.read_bytes(size)
|
||||
.map_err(|e| WasmError::from_binary_reader_error(e))?)?;
|
||||
.map_err(WasmError::from_binary_reader_error)?)?;
|
||||
}
|
||||
loop {
|
||||
match *parser.read() {
|
||||
|
||||
Reference in New Issue
Block a user