Skip to content

Commit

Permalink
Refactor contrived match.
Browse files Browse the repository at this point in the history
  • Loading branch information
leoyvens committed Mar 4, 2018
1 parent 4a316e7 commit 0b0e1b7
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/librustc_mir/transform/lower_128bit.rs
Expand Up @@ -77,19 +77,12 @@ impl Lower128Bit {
};

let bin_statement = block.statements.pop().unwrap();
let (source_info, place, lhs, mut rhs) = match bin_statement {
Statement {
source_info,
kind: StatementKind::Assign(
place,
Rvalue::BinaryOp(_, lhs, rhs))
} => (source_info, place, lhs, rhs),
Statement {
source_info,
kind: StatementKind::Assign(
place,
Rvalue::CheckedBinaryOp(_, lhs, rhs))
} => (source_info, place, lhs, rhs),
let source_info = bin_statement.source_info;
let (place, lhs, mut rhs) = match bin_statement.kind {
StatementKind::Assign(place, Rvalue::BinaryOp(_, lhs, rhs))
| StatementKind::Assign(place, Rvalue::CheckedBinaryOp(_, lhs, rhs)) => {
(place, lhs, rhs)
}
_ => bug!("Statement doesn't match pattern any more?"),
};

Expand Down

0 comments on commit 0b0e1b7

Please sign in to comment.