summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDocWilco <github@drwil.co>2023-09-27 21:33:49 +0200
committerDocWilco <github@drwil.co>2023-09-27 21:33:49 +0200
commitcc658eb28840e63f69f89c8562bbf10333461355 (patch)
tree839e40d64191bae1b6e5f7de2229b620f659abb1
parentda3d55ba03d310a937a2795116a669e274859655 (diff)
fix(cli): make debugging in windows work
On windows, if `stderr` or `stdin` aren't also set to `Stdio::null()` the `spawn()` fails with `The handle is invalid`, and `rustlings` thinks that there's no `rustc` installed.
-rw-r--r--src/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index a4b764d..89bd444 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -396,6 +396,8 @@ fn rustc_exists() -> bool {
Command::new("rustc")
.args(["--version"])
.stdout(Stdio::null())
+ .stderr(Stdio::null())
+ .stdin(Stdio::null())
.spawn()
.and_then(|mut child| child.wait())
.map(|status| status.success())