Rollup merge of #79324 - LingMan:and_then, r=jonas-schievink
Use Option::and_then instead of open-coding it `@rustbot` modify labels to +C-cleanup.
This commit is contained in:
commit
32be3ae06a
@ -37,12 +37,9 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
|
|||||||
/// `funclet_bb` member if it is not `None`.
|
/// `funclet_bb` member if it is not `None`.
|
||||||
fn funclet<'b, Bx: BuilderMethods<'a, 'tcx>>(
|
fn funclet<'b, Bx: BuilderMethods<'a, 'tcx>>(
|
||||||
&self,
|
&self,
|
||||||
fx: &'b mut FunctionCx<'a, 'tcx, Bx>,
|
fx: &'b FunctionCx<'a, 'tcx, Bx>,
|
||||||
) -> Option<&'b Bx::Funclet> {
|
) -> Option<&'b Bx::Funclet> {
|
||||||
match self.funclet_bb {
|
self.funclet_bb.and_then(|funcl| fx.funclets[funcl].as_ref())
|
||||||
Some(funcl) => fx.funclets[funcl].as_ref(),
|
|
||||||
None => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lltarget<Bx: BuilderMethods<'a, 'tcx>>(
|
fn lltarget<Bx: BuilderMethods<'a, 'tcx>>(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user