Adopt let_else in even more places
This commit is contained in:
parent
3cfa4def7c
commit
60f969a4f2
26 changed files with 50 additions and 104 deletions
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue