Avoid unneeded passing by value.
https://github.com/rust-lang-nursery/rust-clippy/wiki#needless_pass_by_value
This commit is contained in:
@@ -156,7 +156,7 @@ impl FunctionImports {
|
||||
pub fn translate_function_body(
|
||||
parser: &mut Parser,
|
||||
function_index: FunctionIndex,
|
||||
sig: Signature,
|
||||
sig: &Signature,
|
||||
locals: &[(usize, Type)],
|
||||
exports: &Option<HashMap<FunctionIndex, String>>,
|
||||
signatures: &[Signature],
|
||||
|
||||
@@ -260,7 +260,7 @@ pub fn translate_module(
|
||||
match translate_function_body(
|
||||
&mut parser,
|
||||
function_index,
|
||||
signature,
|
||||
&signature,
|
||||
&locals,
|
||||
&exports,
|
||||
&signatures,
|
||||
@@ -271,7 +271,7 @@ pub fn translate_module(
|
||||
Ok((il_func, imports)) => {
|
||||
il_functions.push(FunctionTranslation::Code {
|
||||
il: il_func,
|
||||
imports: invert_hashmaps(imports),
|
||||
imports: invert_hashmaps(&imports),
|
||||
})
|
||||
}
|
||||
Err(s) => return Err(s),
|
||||
|
||||
@@ -140,7 +140,7 @@ pub fn translate_type(ty: wasmparser::Type) -> Result<Vec<cretonne::ir::Type>, (
|
||||
/// feeding the function indexes in the module but are used by the runtime with the `FuncRef` as
|
||||
/// keys.
|
||||
pub fn invert_hashmaps(
|
||||
imports: code_translator::FunctionImports,
|
||||
imports: &code_translator::FunctionImports,
|
||||
) -> module_translator::ImportMappings {
|
||||
let mut new_imports = module_translator::ImportMappings::new();
|
||||
for (func_index, func_ref) in &imports.functions {
|
||||
|
||||
Reference in New Issue
Block a user