about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLingMan <LingMan@users.noreply.github.com>2020-10-11 08:32:19 +0200
committerLingMan <LingMan@users.noreply.github.com>2020-11-22 23:44:05 +0100
commit674f196c50240f462f4c6909d40d9d1ded845d66 (patch)
tree3baf74514d8b5391148193e13bf06ad69390f51e
parent828461b4b27c4a955587887936e54057efc5e2c1 (diff)
downloadrust-674f196c50240f462f4c6909d40d9d1ded845d66.tar.gz
rust-674f196c50240f462f4c6909d40d9d1ded845d66.zip
Use Option::and_then instead of open-coding it
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/block.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index fd20709f5d8..9651d0505e6 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -37,12 +37,9 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
     /// `funclet_bb` member if it is not `None`.
     fn funclet<'b, Bx: BuilderMethods<'a, 'tcx>>(
         &self,
-        fx: &'b mut FunctionCx<'a, 'tcx, Bx>,
+        fx: &'b FunctionCx<'a, 'tcx, Bx>,
     ) -> Option<&'b Bx::Funclet> {
-        match self.funclet_bb {
-            Some(funcl) => fx.funclets[funcl].as_ref(),
-            None => None,
-        }
+        self.funclet_bb.and_then(|funcl| fx.funclets[funcl].as_ref())
     }
 
     fn lltarget<Bx: BuilderMethods<'a, 'tcx>>(