Avoid unnecessary '&' in matches.

https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
This commit is contained in:
Dan Gohman
2017-08-31 11:46:05 -07:00
parent acf4f1009b
commit 9a8f01b832
4 changed files with 16 additions and 16 deletions

View File

@@ -10,8 +10,8 @@ use ir::{self, InstBuilder};
/// Expand a `global_addr` instruction according to the definition of the global variable.
pub fn expand_global_addr(inst: ir::Inst, func: &mut ir::Function, _cfg: &mut ControlFlowGraph) {
// Unpack the instruction.
let gv = match &func.dfg[inst] {
&ir::InstructionData::UnaryGlobalVar { opcode, global_var } => {
let gv = match func.dfg[inst] {
ir::InstructionData::UnaryGlobalVar { opcode, global_var } => {
assert_eq!(opcode, ir::Opcode::GlobalAddr);
global_var
}

View File

@@ -11,8 +11,8 @@ use ir::condcodes::IntCC;
/// Expand a `heap_addr` instruction according to the definition of the heap.
pub fn expand_heap_addr(inst: ir::Inst, func: &mut ir::Function, _cfg: &mut ControlFlowGraph) {
// Unpack the instruction.
let (heap, offset, size) = match &func.dfg[inst] {
&ir::InstructionData::HeapAddr {
let (heap, offset, size) = match func.dfg[inst] {
ir::InstructionData::HeapAddr {
opcode,
heap,
arg,