Replace match blocks with .expect calls.
This commit is contained in:
@@ -298,15 +298,11 @@ impl<Variable> SSABuilder<Variable>
|
|||||||
/// Gets the header block corresponding to an Ebb, panics if the Ebb or the header block
|
/// Gets the header block corresponding to an Ebb, panics if the Ebb or the header block
|
||||||
/// isn't declared.
|
/// isn't declared.
|
||||||
pub fn header_block(&self, ebb: Ebb) -> Block {
|
pub fn header_block(&self, ebb: Ebb) -> Block {
|
||||||
match self.ebb_headers.get(ebb) {
|
self.ebb_headers
|
||||||
Some(&header) => {
|
.get(ebb)
|
||||||
match header.expand() {
|
.expect("the ebb has not been declared")
|
||||||
Some(header) => header,
|
.expand()
|
||||||
None => panic!("the header block has not been defined"),
|
.expect("the header block has not been defined")
|
||||||
}
|
|
||||||
}
|
|
||||||
None => panic!("the ebb has not been declared"),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Declares a new predecessor for an `Ebb` header block and record the branch instruction
|
/// Declares a new predecessor for an `Ebb` header block and record the branch instruction
|
||||||
|
|||||||
Reference in New Issue
Block a user