summaryrefslogtreecommitdiff
path: root/src/exercise.rs
diff options
context:
space:
mode:
authorliv <mokou@fastmail.com>2023-09-04 14:34:13 +0200
committerGitHub <noreply@github.com>2023-09-04 14:34:13 +0200
commit0aa941873662918aef679bd77b8b7bd6b1a23ec3 (patch)
tree01115c2e72dd0ca51c4bfb2ac1f043d6d9a0a1ca /src/exercise.rs
parent37cdea9183796909057d8b42ab2866fde1525a40 (diff)
parentabc3013096f20a41009086c0f5ccb1b2b13abf12 (diff)
Merge branch 'main' into chore/update-hints
Diffstat (limited to 'src/exercise.rs')
-rw-r--r--src/exercise.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/exercise.rs b/src/exercise.rs
index 2cde4e1..07251db 100644
--- a/src/exercise.rs
+++ b/src/exercise.rs
@@ -110,12 +110,12 @@ impl Exercise {
pub fn compile(&self) -> Result<CompiledExercise, ExerciseOutput> {
let cmd = match self.mode {
Mode::Compile => Command::new("rustc")
- .args(&[self.path.to_str().unwrap(), "-o", &temp_file()])
+ .args([self.path.to_str().unwrap(), "-o", &temp_file()])
.args(RUSTC_COLOR_ARGS)
.args(RUSTC_EDITION_ARGS)
.output(),
Mode::Test => Command::new("rustc")
- .args(&["--test", self.path.to_str().unwrap(), "-o", &temp_file()])
+ .args(["--test", self.path.to_str().unwrap(), "-o", &temp_file()])
.args(RUSTC_COLOR_ARGS)
.args(RUSTC_EDITION_ARGS)
.output(),
@@ -141,7 +141,7 @@ path = "{}.rs""#,
// compilation failure, this would silently fail. But we expect
// clippy to reflect the same failure while compiling later.
Command::new("rustc")
- .args(&[self.path.to_str().unwrap(), "-o", &temp_file()])
+ .args([self.path.to_str().unwrap(), "-o", &temp_file()])
.args(RUSTC_COLOR_ARGS)
.args(RUSTC_EDITION_ARGS)
.output()
@@ -151,14 +151,14 @@ path = "{}.rs""#,
// This is already fixed on Clippy's master branch. See this issue to track merging into Cargo:
// https://github.com/rust-lang/rust-clippy/issues/3837
Command::new("cargo")
- .args(&["clean", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
+ .args(["clean", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
.args(RUSTC_COLOR_ARGS)
.output()
.expect("Failed to run 'cargo clean'");
Command::new("cargo")
- .args(&["clippy", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
+ .args(["clippy", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
.args(RUSTC_COLOR_ARGS)
- .args(&["--", "-D", "warnings", "-D", "clippy::float_cmp"])
+ .args(["--", "-D", "warnings", "-D", "clippy::float_cmp"])
.output()
}
}
@@ -183,7 +183,7 @@ path = "{}.rs""#,
Mode::Test => "--show-output",
_ => "",
};
- let cmd = Command::new(&temp_file())
+ let cmd = Command::new(temp_file())
.arg(arg)
.output()
.expect("Failed to run 'run' command");
@@ -260,7 +260,7 @@ impl Display for Exercise {
#[inline]
fn clean() {
- let _ignored = remove_file(&temp_file());
+ let _ignored = remove_file(temp_file());
}
#[cfg(test)]
@@ -270,7 +270,7 @@ mod test {
#[test]
fn test_clean() {
- File::create(&temp_file()).unwrap();
+ File::create(temp_file()).unwrap();
let exercise = Exercise {
name: String::from("example"),
path: PathBuf::from("tests/fixture/state/pending_exercise.rs"),