From 0be8c05509dde6ed47fb0b4d42450c9cbaf6ba73 Mon Sep 17 00:00:00 2001 From: owenlch Date: Mon, 21 Oct 2024 22:57:27 +0800 Subject: [PATCH] Fix windows build --- src/build_context.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/build_context.rs b/src/build_context.rs index 1fb102393..a66398acc 100644 --- a/src/build_context.rs +++ b/src/build_context.rs @@ -1179,10 +1179,8 @@ impl BuildContext { #[cfg(windows)] { Command::new("cmd") - .args(&["/C", tf.path().to_str().unwrap()]) - .args("-y") - .arg("--default-toolchain") - .arg("none") + .args(["/C", tf.path().to_str().unwrap()]) + .args(vec!["-y", "--default-toolchain", "none"]) .env("RUSTUP_HOME", rustup_home) .env("CARGO_HOME", cargo_home) .status()?; @@ -1220,8 +1218,8 @@ impl BuildContext { let new_path = format!("{};{}", cargo_bin_path, current_path); env::set_var("PATH", &new_path); Command::new("cmd") - .args(&["/C", "rustup default stable"]) - .status(); + .args(vec!["/C", "rustup default stable"]) + .status()?; } Ok(())