mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 00:00:03 +03:00
Merge pull request #1916 from mo8it/command
Pipe the output of command to null instead of capturing and ignoring it
This commit is contained in:
commit
07dec76f7c
|
@ -5,7 +5,7 @@ use std::fmt::{self, Display, Formatter};
|
||||||
use std::fs::{self, remove_file, File};
|
use std::fs::{self, remove_file, File};
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::{self, Command};
|
use std::process::{self, Command, Stdio};
|
||||||
|
|
||||||
const RUSTC_COLOR_ARGS: &[&str] = &["--color", "always"];
|
const RUSTC_COLOR_ARGS: &[&str] = &["--color", "always"];
|
||||||
const RUSTC_EDITION_ARGS: &[&str] = &["--edition", "2021"];
|
const RUSTC_EDITION_ARGS: &[&str] = &["--edition", "2021"];
|
||||||
|
@ -148,7 +148,10 @@ path = "{}.rs""#,
|
||||||
.args(RUSTC_COLOR_ARGS)
|
.args(RUSTC_COLOR_ARGS)
|
||||||
.args(RUSTC_EDITION_ARGS)
|
.args(RUSTC_EDITION_ARGS)
|
||||||
.args(RUSTC_NO_DEBUG_ARGS)
|
.args(RUSTC_NO_DEBUG_ARGS)
|
||||||
.output()
|
.stdin(Stdio::null())
|
||||||
|
.stdout(Stdio::null())
|
||||||
|
.stderr(Stdio::null())
|
||||||
|
.status()
|
||||||
.expect("Failed to compile!");
|
.expect("Failed to compile!");
|
||||||
// Due to an issue with Clippy, a cargo clean is required to catch all lints.
|
// Due to an issue with Clippy, a cargo clean is required to catch all lints.
|
||||||
// See https://github.com/rust-lang/rust-clippy/issues/2604
|
// See https://github.com/rust-lang/rust-clippy/issues/2604
|
||||||
|
@ -157,7 +160,10 @@ path = "{}.rs""#,
|
||||||
Command::new("cargo")
|
Command::new("cargo")
|
||||||
.args(["clean", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
|
.args(["clean", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
|
||||||
.args(RUSTC_COLOR_ARGS)
|
.args(RUSTC_COLOR_ARGS)
|
||||||
.output()
|
.stdin(Stdio::null())
|
||||||
|
.stdout(Stdio::null())
|
||||||
|
.stderr(Stdio::null())
|
||||||
|
.status()
|
||||||
.expect("Failed to run 'cargo clean'");
|
.expect("Failed to run 'cargo clean'");
|
||||||
Command::new("cargo")
|
Command::new("cargo")
|
||||||
.args(["clippy", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
|
.args(["clippy", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
|
||||||
|
|
Loading…
Reference in a new issue