Skip to content

Commit e5cba3e

Browse files
committed
Clippy fixes
1 parent 4449ff1 commit e5cba3e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

objdiff-core/src/arch/ppc.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,12 @@ fn generate_fake_pool_reloc_for_addr_mapping(
601601
}
602602
}
603603
}
604-
match ins.op {
605-
Opcode::Bcctr => {
606-
if simplified.mnemonic == "bctr" {
607-
// Unconditional branch to count register.
608-
// Likely a jump table.
609-
gpr_state_at_bctr.insert(cur_addr, gpr_pool_relocs.clone());
610-
}
604+
if let Opcode::Bcctr = ins.op {
605+
if simplified.mnemonic == "bctr" {
606+
// Unconditional branch to count register.
607+
// Likely a jump table.
608+
gpr_state_at_bctr.insert(cur_addr, gpr_pool_relocs.clone());
611609
}
612-
_ => {}
613610
}
614611

615612
// Then handle keeping track of which GPR contains which pool relocation.
@@ -692,13 +689,13 @@ fn generate_fake_pool_reloc_for_addr_mapping(
692689
if ins_iters_with_gpr_state.is_empty() {
693690
let unseen_addrs = (func_address as u32..func_address as u32 + code.len() as u32)
694691
.step_by(4)
695-
.filter(|addr| !visited_ins_addrs.contains(&addr));
692+
.filter(|addr| !visited_ins_addrs.contains(addr));
696693
for unseen_addr in unseen_addrs {
697694
let prev_bctr_gpr_state = gpr_state_at_bctr
698695
.iter()
699696
.filter(|(&addr, _)| addr < unseen_addr)
700697
.min_by_key(|(&addr, _)| addr)
701-
.and_then(|(_, gpr_state)| Some(gpr_state));
698+
.map(|(_, gpr_state)| gpr_state);
702699
if let Some(gpr_pool_relocs) = prev_bctr_gpr_state {
703700
let dest_offset_into_func = unseen_addr - func_address as u32;
704701
let dest_code_slice = &code[dest_offset_into_func as usize..];

0 commit comments

Comments
 (0)