Skip to content

Commit 674f196

Browse files
committed
Use Option::and_then instead of open-coding it
1 parent 828461b commit 674f196

File tree

1 file changed

+2
-5
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+2
-5
lines changed

compiler/rustc_codegen_ssa/src/mir/block.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
3737
/// `funclet_bb` member if it is not `None`.
3838
fn funclet<'b, Bx: BuilderMethods<'a, 'tcx>>(
3939
&self,
40-
fx: &'b mut FunctionCx<'a, 'tcx, Bx>,
40+
fx: &'b FunctionCx<'a, 'tcx, Bx>,
4141
) -> Option<&'b Bx::Funclet> {
42-
match self.funclet_bb {
43-
Some(funcl) => fx.funclets[funcl].as_ref(),
44-
None => None,
45-
}
42+
self.funclet_bb.and_then(|funcl| fx.funclets[funcl].as_ref())
4643
}
4744

4845
fn lltarget<Bx: BuilderMethods<'a, 'tcx>>(

0 commit comments

Comments
 (0)