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(
|
pub fn translate_function_body(
|
||||||
parser: &mut Parser,
|
parser: &mut Parser,
|
||||||
function_index: FunctionIndex,
|
function_index: FunctionIndex,
|
||||||
sig: Signature,
|
sig: &Signature,
|
||||||
locals: &[(usize, Type)],
|
locals: &[(usize, Type)],
|
||||||
exports: &Option<HashMap<FunctionIndex, String>>,
|
exports: &Option<HashMap<FunctionIndex, String>>,
|
||||||
signatures: &[Signature],
|
signatures: &[Signature],
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ pub fn translate_module(
|
|||||||
match translate_function_body(
|
match translate_function_body(
|
||||||
&mut parser,
|
&mut parser,
|
||||||
function_index,
|
function_index,
|
||||||
signature,
|
&signature,
|
||||||
&locals,
|
&locals,
|
||||||
&exports,
|
&exports,
|
||||||
&signatures,
|
&signatures,
|
||||||
@@ -271,7 +271,7 @@ pub fn translate_module(
|
|||||||
Ok((il_func, imports)) => {
|
Ok((il_func, imports)) => {
|
||||||
il_functions.push(FunctionTranslation::Code {
|
il_functions.push(FunctionTranslation::Code {
|
||||||
il: il_func,
|
il: il_func,
|
||||||
imports: invert_hashmaps(imports),
|
imports: invert_hashmaps(&imports),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Err(s) => return Err(s),
|
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
|
/// feeding the function indexes in the module but are used by the runtime with the `FuncRef` as
|
||||||
/// keys.
|
/// keys.
|
||||||
pub fn invert_hashmaps(
|
pub fn invert_hashmaps(
|
||||||
imports: code_translator::FunctionImports,
|
imports: &code_translator::FunctionImports,
|
||||||
) -> module_translator::ImportMappings {
|
) -> module_translator::ImportMappings {
|
||||||
let mut new_imports = module_translator::ImportMappings::new();
|
let mut new_imports = module_translator::ImportMappings::new();
|
||||||
for (func_index, func_ref) in &imports.functions {
|
for (func_index, func_ref) in &imports.functions {
|
||||||
|
|||||||
Reference in New Issue
Block a user