Skip to content

Commit 5ae2446

Browse files
committed
simplify Builder::doc_rust_lang_org_channel
This is already handled at the config parsing level, so we can simplify it. Signed-off-by: onur-ozkan <[email protected]>
1 parent 207c5bc commit 5ae2446

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/bootstrap/src/core/builder.rs

+6-17
Original file line numberDiff line numberDiff line change
@@ -1036,23 +1036,12 @@ impl<'a> Builder<'a> {
10361036
}
10371037

10381038
pub fn doc_rust_lang_org_channel(&self) -> String {
1039-
// When using precompiled compiler from CI, we need to use CI rustc's channel and
1040-
// ignore `rust.channel` from the configuration. Otherwise most of the rustdoc tests
1041-
// will fail due to incompatible `DOC_RUST_LANG_ORG_CHANNEL`.
1042-
let channel = if let Some(commit) = self.config.download_rustc_commit() {
1043-
self.config
1044-
.read_file_by_commit(&PathBuf::from("src/ci/channel"), commit)
1045-
.trim()
1046-
.to_owned()
1047-
} else {
1048-
match &*self.config.channel {
1049-
"stable" => &self.version,
1050-
"beta" => "beta",
1051-
"nightly" | "dev" => "nightly",
1052-
// custom build of rustdoc maybe? link to the latest stable docs just in case
1053-
_ => "stable",
1054-
}
1055-
.to_owned()
1039+
let channel = match &*self.config.channel {
1040+
"stable" => &self.version,
1041+
"beta" => "beta",
1042+
"nightly" | "dev" => "nightly",
1043+
// custom build of rustdoc maybe? link to the latest stable docs just in case
1044+
_ => "stable",
10561045
};
10571046

10581047
format!("https://doc.rust-lang.org/{channel}")

0 commit comments

Comments
 (0)