Skip to content

Commit

Permalink
Use Option::and_then instead of open-coding it
Browse files Browse the repository at this point in the history
  • Loading branch information
LingMan committed Nov 22, 2020
1 parent 828461b commit 674f196
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>>(
Expand Down

0 comments on commit 674f196

Please sign in to comment.