pub out: PathBuf,
}
+#[derive(Default, Deserialize)]
+#[cfg_attr(test, derive(Clone))]
+pub struct Stage0Metadata {
+ pub config: Stage0Config,
+ pub checksums_sha256: HashMap<String, String>,
+ pub rustfmt: Option<RustfmtMetadata>,
+}
+#[derive(Default, Deserialize)]
+#[cfg_attr(test, derive(Clone))]
+pub struct Stage0Config {
+ pub dist_server: String,
+ pub artifacts_server: String,
+ pub artifacts_with_llvm_assertions_server: String,
+ pub git_merge_commit_email: String,
+}
+#[derive(Default, Deserialize)]
+#[cfg_attr(test, derive(Clone))]
+pub struct RustfmtMetadata {
+ pub date: String,
+ pub version: String,
+}
+
#[derive(Clone, Debug)]
pub enum RustfmtState {
SystemToolchain(PathBuf),
}
}
-#[derive(Default, Deserialize)]
-#[cfg_attr(test, derive(Clone))]
-pub struct Stage0Metadata {
- pub config: Stage0Config,
- pub checksums_sha256: HashMap<String, String>,
- pub rustfmt: Option<RustfmtMetadata>,
-}
-#[derive(Default, Deserialize)]
-#[cfg_attr(test, derive(Clone))]
-pub struct Stage0Config {
- pub dist_server: String,
- pub artifacts_server: String,
- pub artifacts_with_llvm_assertions_server: String,
- pub git_merge_commit_email: String,
-}
-#[derive(Default, Deserialize)]
-#[cfg_attr(test, derive(Clone))]
-pub struct RustfmtMetadata {
- pub date: String,
- pub version: String,
-}
-
impl Config {
pub fn default_opts() -> Config {
let mut config = Config::default();
fn threads_from_config(v: u32) -> u32 {
match v {
- 0 => std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get) as u32,
+ 0 => num_cpus::get() as u32,
n => n,
}
}