From 110697cfddbb2b8698ad45eb643d2a01ad30c10d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 30 Aug 2017 11:17:25 -0700 Subject: [PATCH] Replace match blocks with .expect calls. --- lib/frontend/src/ssa.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 3d20e9d86a..f4b73c280a 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -298,15 +298,11 @@ impl SSABuilder /// Gets the header block corresponding to an Ebb, panics if the Ebb or the header block /// isn't declared. pub fn header_block(&self, ebb: Ebb) -> Block { - match self.ebb_headers.get(ebb) { - Some(&header) => { - match header.expand() { - Some(header) => header, - None => panic!("the header block has not been defined"), - } - } - None => panic!("the ebb has not been declared"), - } + self.ebb_headers + .get(ebb) + .expect("the ebb has not been declared") + .expand() + .expect("the header block has not been defined") } /// Declares a new predecessor for an `Ebb` header block and record the branch instruction