about summary refs log tree commit diff
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2023-10-27 07:03:48 +0300
committeronur-ozkan <work@onurozkan.dev>2023-11-08 14:06:01 +0300
commite8781003862a316c81c58ef8bc69b8c6e099c01b (patch)
treea4f1ae5546bd2045a7b4af9a017449686aed4a80
parentae4d18b2da7a1d044481948bb84f40ba4eec24c5 (diff)
downloadrust-e8781003862a316c81c58ef8bc69b8c6e099c01b.tar.gz
rust-e8781003862a316c81c58ef8bc69b8c6e099c01b.zip
bootstrap: improve `fn check_version`
Signed-off-by: onur-ozkan <work@onurozkan.dev>
-rw-r--r--src/bootstrap/src/bin/main.rs42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs
index e0caecca5c0..6c0d8c8c550 100644
--- a/src/bootstrap/src/bin/main.rs
+++ b/src/bootstrap/src/bin/main.rs
@@ -110,29 +110,29 @@ fn check_version(config: &Config) -> Option<String> {
 
     let latest_config_id = CONFIG_CHANGE_HISTORY.last().unwrap();
     if let Some(id) = config.change_id {
-        if &id != latest_config_id {
-            let change_links: Vec<String> = find_recent_config_change_ids(id)
-                .iter()
-                .map(|id| format!("https://github.com/rust-lang/rust/pull/{id}"))
-                .collect();
-            if !change_links.is_empty() {
-                msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
-                msg.push_str("To see more detail about these changes, visit the following PRs:\n");
-
-                for link in change_links {
-                    msg.push_str(&format!("  - {link}\n"));
-                }
-
-                msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
-
-                msg.push_str("note: to silence this warning, ");
-                msg.push_str(&format!(
-                    "update `config.toml` to use `change-id = {latest_config_id}` instead"
-                ));
-            }
-        } else {
+        if &id == latest_config_id {
             return None;
         }
+
+        let change_links: Vec<String> = find_recent_config_change_ids(id)
+            .iter()
+            .map(|id| format!("https://github.com/rust-lang/rust/pull/{id}"))
+            .collect();
+        if !change_links.is_empty() {
+            msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
+            msg.push_str("To see more detail about these changes, visit the following PRs:\n");
+
+            for link in change_links {
+                msg.push_str(&format!("  - {link}\n"));
+            }
+
+            msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
+
+            msg.push_str("note: to silence this warning, ");
+            msg.push_str(&format!(
+                "update `config.toml` to use `change-id = {latest_config_id}` instead"
+            ));
+        }
     } else {
         msg.push_str("WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.\n");
         msg.push_str("note: to silence this warning, ");