diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-04-28 02:40:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-28 02:40:36 +0200 |
| commit | 4c628bbb1c266a8513b364dca5ae7e311a1e0777 (patch) | |
| tree | 6a052354aee525e972374b8a8c1e79833e4c2f20 /compiler/rustc_mir_transform | |
| parent | 6f6fe3e651832796b2454dad5adafe9e21a09498 (diff) | |
| parent | f697955c1eb72e3dac6b6aafa411e58cb8d18706 (diff) | |
| download | rust-4c628bbb1c266a8513b364dca5ae7e311a1e0777.tar.gz rust-4c628bbb1c266a8513b364dca5ae7e311a1e0777.zip | |
Rollup merge of #96471 - BoxyUwU:let_else_considered_harmful, r=lcnr
replace let else with `?` r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_mir_transform')
| -rw-r--r-- | compiler/rustc_mir_transform/src/early_otherwise_branch.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/early_otherwise_branch.rs b/compiler/rustc_mir_transform/src/early_otherwise_branch.rs index 5bde0c01412..33f201cbd28 100644 --- a/compiler/rustc_mir_transform/src/early_otherwise_branch.rs +++ b/compiler/rustc_mir_transform/src/early_otherwise_branch.rs @@ -336,9 +336,7 @@ fn evaluate_candidate<'tcx>( Some(poss) } }; - let Some((_, child)) = targets.iter().next() else { - return None - }; + let (_, child) = targets.iter().next()?; let child_terminator = &bbs[child].terminator(); let TerminatorKind::SwitchInt { switch_ty: child_ty, |
