Use let
/else
to reduce some indentation.
This commit is contained in:
parent
243109e006
commit
8541b0f1f3
1 changed files with 16 additions and 17 deletions
|
@ -570,7 +570,9 @@ fn transform_async_context<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||||
|
|
||||||
fn eliminate_get_context_call<'tcx>(bb_data: &mut BasicBlockData<'tcx>) -> Local {
|
fn eliminate_get_context_call<'tcx>(bb_data: &mut BasicBlockData<'tcx>) -> Local {
|
||||||
let terminator = bb_data.terminator.take().unwrap();
|
let terminator = bb_data.terminator.take().unwrap();
|
||||||
if let TerminatorKind::Call { args, destination, target, .. } = terminator.kind {
|
let TerminatorKind::Call { args, destination, target, .. } = terminator.kind else {
|
||||||
|
bug!();
|
||||||
|
};
|
||||||
let [arg] = *Box::try_from(args).unwrap();
|
let [arg] = *Box::try_from(args).unwrap();
|
||||||
let local = arg.node.place().unwrap().local;
|
let local = arg.node.place().unwrap().local;
|
||||||
|
|
||||||
|
@ -585,9 +587,6 @@ fn eliminate_get_context_call<'tcx>(bb_data: &mut BasicBlockData<'tcx>) -> Local
|
||||||
kind: TerminatorKind::Goto { target: target.unwrap() },
|
kind: TerminatorKind::Goto { target: target.unwrap() },
|
||||||
});
|
});
|
||||||
local
|
local
|
||||||
} else {
|
|
||||||
bug!();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(not(debug_assertions), allow(unused))]
|
#[cfg_attr(not(debug_assertions), allow(unused))]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue