Loop over references to containers instead of using explicit iteration methods.
https://github.com/rust-lang-nursery/rust-clippy/wiki#explicit_iter_loop
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -142,10 +142,10 @@ pub fn translate_type(ty: wasmparser::Type) -> Result<Vec<cretonne::ir::Type>, (
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user