Reuse logic for determining the channel in the rest of rustdoc

This doesn't update main.js because it's included as a fixed string.
This commit is contained in:
Joshua Nelson
2021-04-06 14:51:36 -04:00
parent 9866ea0ac5
commit 3478f83c0a
5 changed files with 29 additions and 22 deletions

View File

@@ -82,6 +82,8 @@ use rustc_session::config::{make_crate_type_option, ErrorOutputType, RustcOptGro
use rustc_session::getopts;
use rustc_session::{early_error, early_warn};
use crate::clean::utils::doc_rust_lang_org_channel;
/// A macro to create a FxHashMap.
///
/// Example:
@@ -597,7 +599,10 @@ fn usage(argv0: &str) {
}
println!("{}", options.usage(&format!("{} [options] <input>", argv0)));
println!(" @path Read newline separated options from `path`\n");
println!("More information available at https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html")
println!(
"More information available at https://doc.rust-lang.org/{}/rustdoc/what-is-rustdoc.html",
doc_rust_lang_org_channel()
);
}
/// A result type used by several functions under `main()`.