diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 57c0aaa9e0..1b69acab00 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -492,7 +492,7 @@ impl<'a, Variable> FunctionBuilder<'a, Variable> fn fill_function_args_values(&mut self, ebb: Ebb) { debug_assert!(self.pristine); - for argtyp in self.func.signature.argument_types.iter() { + for argtyp in &self.func.signature.argument_types { self.builder .function_args_values .push(self.func.dfg.append_ebb_arg(ebb, argtyp.value_type)); diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index d5d2b51bc4..310434e54d 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -402,7 +402,7 @@ impl SSABuilder }; // For each undef var we look up values in the predecessors and create an Ebb argument // only if necessary. - for &(var, val) in undef_vars.iter() { + for &(var, val) in &undef_vars { let (_, mut local_side_effects) = self.predecessors_lookup(dfg, layout, jts, val, var, ebb, &predecessors); side_effects diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index d720ea34fc..dcab3f3699 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -506,7 +506,7 @@ fn translate_operator(op: &Operator, Operator::BrTable { ref table } => { let (depths, default) = table.read_table(); let mut min_depth = default; - for depth in depths.iter() { + for depth in &depths { if *depth < min_depth { min_depth = *depth; } diff --git a/lib/wasm/src/translation_utils.rs b/lib/wasm/src/translation_utils.rs index 609b4a3dfc..88686d4221 100644 --- a/lib/wasm/src/translation_utils.rs +++ b/lib/wasm/src/translation_utils.rs @@ -142,10 +142,10 @@ pub fn translate_type(ty: wasmparser::Type) -> Result, ( pub fn invert_hashmaps(imports: code_translator::FunctionImports) -> module_translator::ImportMappings { let mut new_imports = module_translator::ImportMappings::new(); - for (func_index, func_ref) in imports.functions.iter() { + for (func_index, func_ref) in &imports.functions { new_imports.functions.insert(*func_ref, *func_index); } - for (sig_index, sig_ref) in imports.signatures.iter() { + for (sig_index, sig_ref) in &imports.signatures { new_imports.signatures.insert(*sig_ref, *sig_index); } new_imports