Use Option::and_then instead of open-coding it

This commit is contained in:
LingMan 2020-10-11 08:32:19 +02:00
parent 828461b4b2
commit 674f196c50

View File

@ -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>>(