about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/entry.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-11 17:23:56 -0400
committerMichael Goulet <michael@errs.io>2024-09-11 17:24:01 -0400
commitaf8d911d63d6b38ea2da36a330b035dd2e6f89a7 (patch)
treead39949e1071a021f16e808ecf00f6148dd0d488 /compiler/rustc_ast/src/entry.rs
parent954419aab01264707f116899e77be682b02764ea (diff)
downloadrust-af8d911d63d6b38ea2da36a330b035dd2e6f89a7.tar.gz
rust-af8d911d63d6b38ea2da36a330b035dd2e6f89a7.zip
Also fix if in else
Diffstat (limited to 'compiler/rustc_ast/src/entry.rs')
-rw-r--r--compiler/rustc_ast/src/entry.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/compiler/rustc_ast/src/entry.rs b/compiler/rustc_ast/src/entry.rs
index 60a12614f06..53276e0847a 100644
--- a/compiler/rustc_ast/src/entry.rs
+++ b/compiler/rustc_ast/src/entry.rs
@@ -45,18 +45,16 @@ pub fn entry_point_type(
         EntryPointType::Start
     } else if attr::contains_name(attrs, sym::rustc_main) {
         EntryPointType::RustcMainAttr
-    } else {
-        if let Some(name) = name
-            && name == sym::main
-        {
-            if at_root {
-                // This is a top-level function so it can be `main`.
-                EntryPointType::MainNamed
-            } else {
-                EntryPointType::OtherMain
-            }
+    } else if let Some(name) = name
+        && name == sym::main
+    {
+        if at_root {
+            // This is a top-level function so it can be `main`.
+            EntryPointType::MainNamed
         } else {
-            EntryPointType::None
+            EntryPointType::OtherMain
         }
+    } else {
+        EntryPointType::None
     }
 }