]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/lib.rs
Auto merge of #34638 - zackmdavis:if_let_over_none_empty_block_arm, r=jseyfried
[rust.git] / src / librustc_typeck / lib.rs
index 6239506c2d7800fac75b9415b14cbc850481864c..84452589dfda389a9bc7e708c55dc16f9f497e9f 100644 (file)
@@ -312,14 +312,13 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
 fn check_for_entry_fn(ccx: &CrateCtxt) {
     let tcx = ccx.tcx;
     let _task = tcx.dep_graph.in_task(DepNode::CheckEntryFn);
-    match *tcx.sess.entry_fn.borrow() {
-        Some((id, sp)) => match tcx.sess.entry_type.get() {
+    if let Some((id, sp)) = *tcx.sess.entry_fn.borrow() {
+        match tcx.sess.entry_type.get() {
             Some(config::EntryMain) => check_main_fn_ty(ccx, id, sp),
             Some(config::EntryStart) => check_start_fn_ty(ccx, id, sp),
             Some(config::EntryNone) => {}
             None => bug!("entry function without a type")
-        },
-        None => {}
+        }
     }
 }