1
Fork 0

Adopt let_else in even more places

This commit is contained in:
est31 2022-02-15 05:58:25 +01:00
parent 3cfa4def7c
commit 60f969a4f2
26 changed files with 50 additions and 104 deletions

View file

@ -1241,9 +1241,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
}
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let yield_ty = if let Some(yield_ty) = body.yield_ty() {
yield_ty
} else {
let Some(yield_ty) = body.yield_ty() else {
// This only applies to generators
return;
};

View file

@ -211,12 +211,7 @@ fn normalize_array_len_call<'tcx>(
let Some(local) = place.as_local() else { return };
match operand {
Operand::Copy(place) | Operand::Move(place) => {
let operand_local =
if let Some(local) = place.local_or_deref_local() {
local
} else {
return;
};
let Some(operand_local) = place.local_or_deref_local() else { return; };
if !interesting_locals.contains(operand_local) {
return;
}