Use [] instead of .get().unwrap().
https://github.com/rust-lang-nursery/rust-clippy/wiki#get_unwrap
This commit is contained in:
@@ -567,7 +567,7 @@ fn translate_operator(
|
||||
acc.insert(depth as usize, branch_ebb);
|
||||
return acc;
|
||||
};
|
||||
let branch_ebb = acc.get(&(depth as usize)).unwrap().clone();
|
||||
let branch_ebb = acc[&(depth as usize)].clone();
|
||||
builder.insert_jump_table_entry(jt, index, branch_ebb);
|
||||
acc
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ impl WasmRuntime for DummyRuntime {
|
||||
builder: &mut FunctionBuilder<Local>,
|
||||
global_index: GlobalIndex,
|
||||
) -> Value {
|
||||
let ref glob = self.globals.get(global_index as usize).unwrap();
|
||||
let ref glob = self.globals[global_index as usize];
|
||||
match glob.ty {
|
||||
I32 => builder.ins().iconst(glob.ty, -1),
|
||||
I64 => builder.ins().iconst(glob.ty, -1),
|
||||
|
||||
Reference in New Issue
Block a user