Combine redundant match arm bodies.

This commit is contained in:
Dan Gohman
2017-11-03 16:40:51 -07:00
parent c7f01f88b2
commit acc6d941a3
6 changed files with 14 additions and 14 deletions

View File

@@ -356,8 +356,8 @@ impl InstructionData {
/// Multi-destination branches like `br_table` return `None`.
pub fn branch_destination(&self) -> Option<Ebb> {
match *self {
InstructionData::Jump { destination, .. } => Some(destination),
InstructionData::Branch { destination, .. } => Some(destination),
InstructionData::Jump { destination, .. } |
InstructionData::Branch { destination, .. } |
InstructionData::BranchIcmp { destination, .. } => Some(destination),
_ => None,
}
@@ -369,8 +369,8 @@ impl InstructionData {
/// Multi-destination branches like `br_table` return `None`.
pub fn branch_destination_mut(&mut self) -> Option<&mut Ebb> {
match *self {
InstructionData::Jump { ref mut destination, .. } => Some(destination),
InstructionData::Branch { ref mut destination, .. } => Some(destination),
InstructionData::Jump { ref mut destination, .. } |
InstructionData::Branch { ref mut destination, .. } |
InstructionData::BranchIcmp { ref mut destination, .. } => Some(destination),
_ => None,
}