Skip to content

Commit e878100

Browse files
committed
bootstrap: improve fn check_version
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent ae4d18b commit e878100

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/bootstrap/src/bin/main.rs

+21-21
Original file line numberDiff line numberDiff line change
@@ -110,29 +110,29 @@ fn check_version(config: &Config) -> Option<String> {
110110

111111
let latest_config_id = CONFIG_CHANGE_HISTORY.last().unwrap();
112112
if let Some(id) = config.change_id {
113-
if &id != latest_config_id {
114-
let change_links: Vec<String> = find_recent_config_change_ids(id)
115-
.iter()
116-
.map(|id| format!("https://github.com/rust-lang/rust/pull/{id}"))
117-
.collect();
118-
if !change_links.is_empty() {
119-
msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
120-
msg.push_str("To see more detail about these changes, visit the following PRs:\n");
121-
122-
for link in change_links {
123-
msg.push_str(&format!(" - {link}\n"));
124-
}
125-
126-
msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
127-
128-
msg.push_str("note: to silence this warning, ");
129-
msg.push_str(&format!(
130-
"update `config.toml` to use `change-id = {latest_config_id}` instead"
131-
));
132-
}
133-
} else {
113+
if &id == latest_config_id {
134114
return None;
135115
}
116+
117+
let change_links: Vec<String> = find_recent_config_change_ids(id)
118+
.iter()
119+
.map(|id| format!("https://github.com/rust-lang/rust/pull/{id}"))
120+
.collect();
121+
if !change_links.is_empty() {
122+
msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
123+
msg.push_str("To see more detail about these changes, visit the following PRs:\n");
124+
125+
for link in change_links {
126+
msg.push_str(&format!(" - {link}\n"));
127+
}
128+
129+
msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
130+
131+
msg.push_str("note: to silence this warning, ");
132+
msg.push_str(&format!(
133+
"update `config.toml` to use `change-id = {latest_config_id}` instead"
134+
));
135+
}
136136
} else {
137137
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");
138138
msg.push_str("note: to silence this warning, ");

0 commit comments

Comments
 (0)