Use [] instead of .get().unwrap().

https://github.com/rust-lang-nursery/rust-clippy/wiki#get_unwrap
This commit is contained in:
Dan Gohman
2017-08-31 11:37:58 -07:00
parent 2efdc0ed37
commit b411d01d6d
2 changed files with 2 additions and 2 deletions

View File

@@ -567,7 +567,7 @@ fn translate_operator(
acc.insert(depth as usize, branch_ebb); acc.insert(depth as usize, branch_ebb);
return acc; 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); builder.insert_jump_table_entry(jt, index, branch_ebb);
acc acc
}); });

View File

@@ -26,7 +26,7 @@ impl WasmRuntime for DummyRuntime {
builder: &mut FunctionBuilder<Local>, builder: &mut FunctionBuilder<Local>,
global_index: GlobalIndex, global_index: GlobalIndex,
) -> Value { ) -> Value {
let ref glob = self.globals.get(global_index as usize).unwrap(); let ref glob = self.globals[global_index as usize];
match glob.ty { match glob.ty {
I32 => builder.ins().iconst(glob.ty, -1), I32 => builder.ins().iconst(glob.ty, -1),
I64 => builder.ins().iconst(glob.ty, -1), I64 => builder.ins().iconst(glob.ty, -1),