From e7b7897ae2313e54bb324df509f3a4e0d1218f11 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 22 Nov 2022 16:36:23 -0800 Subject: [PATCH] Placate clippy (#1423) --- bin/ref-type/tests/integration.rs | 2 +- bin/update-contributors/src/main.rs | 2 +- src/justfile.rs | 13 +------------ tests/command.rs | 4 ++-- tests/invocation_directory.rs | 2 +- tests/search.rs | 26 +++++++++++++------------- tests/test.rs | 2 +- tests/working_directory.rs | 4 ++-- 8 files changed, 22 insertions(+), 33 deletions(-) diff --git a/bin/ref-type/tests/integration.rs b/bin/ref-type/tests/integration.rs index 20bad36..4c52f21 100644 --- a/bin/ref-type/tests/integration.rs +++ b/bin/ref-type/tests/integration.rs @@ -3,7 +3,7 @@ use std::{process::Command, str}; fn stdout(reference: &str) -> String { let output = Command::new(executable_path("ref-type")) - .args(&["--reference", reference]) + .args(["--reference", reference]) .output() .unwrap(); diff --git a/bin/update-contributors/src/main.rs b/bin/update-contributors/src/main.rs index 9f2d838..6b7168f 100644 --- a/bin/update-contributors/src/main.rs +++ b/bin/update-contributors/src/main.rs @@ -6,7 +6,7 @@ use { fn author(pr: u64) -> String { eprintln!("#{}", pr); let output = Command::new("sh") - .args(&[ + .args([ "-c", &format!("gh pr view {} --json author | jq -r .author.login", pr), ]) diff --git a/src/justfile.rs b/src/justfile.rs index 15d4c5b..6dd5fd2 100644 --- a/src/justfile.rs +++ b/src/justfile.rs @@ -257,15 +257,7 @@ impl<'src> Justfile<'src> { let mut ran = BTreeSet::new(); for (recipe, arguments) in grouped { - Self::run_recipe( - &context, - recipe, - arguments, - &dotenv, - search, - &self.settings, - &mut ran, - )?; + Self::run_recipe(&context, recipe, arguments, &dotenv, search, &mut ran)?; } Ok(()) @@ -289,7 +281,6 @@ impl<'src> Justfile<'src> { arguments: &[&str], dotenv: &BTreeMap, search: &Search, - settings: &Settings, ran: &mut BTreeSet>, ) -> RunResult<'src, ()> { let mut invocation = vec![recipe.name().to_owned()]; @@ -328,7 +319,6 @@ impl<'src> Justfile<'src> { &arguments.iter().map(String::as_ref).collect::>(), dotenv, search, - settings, ran, )?; } @@ -351,7 +341,6 @@ impl<'src> Justfile<'src> { &evaluated.iter().map(String::as_ref).collect::>(), dotenv, search, - settings, &mut ran, )?; } diff --git a/tests/command.rs b/tests/command.rs index 47cd039..abf18c3 100644 --- a/tests/command.rs +++ b/tests/command.rs @@ -106,7 +106,7 @@ fn working_directory_is_correct() { fs::create_dir(tmp.path().join("foo")).unwrap(); let output = Command::new(&executable_path("just")) - .args(&["--command", "cat", "bar"]) + .args(["--command", "cat", "bar"]) .current_dir(tmp.path().join("foo")) .output() .unwrap(); @@ -125,7 +125,7 @@ fn command_not_found() { fs::write(tmp.path().join("justfile"), "").unwrap(); let output = Command::new(&executable_path("just")) - .args(&["--command", "asdfasdfasdfasdfadfsadsfadsf", "bar"]) + .args(["--command", "asdfasdfasdfasdfadfsadsfadsf", "bar"]) .output() .unwrap(); diff --git a/tests/invocation_directory.rs b/tests/invocation_directory.rs index b45e05e..00cda35 100644 --- a/tests/invocation_directory.rs +++ b/tests/invocation_directory.rs @@ -50,7 +50,7 @@ fn test_invocation_directory() { let output = Command::new(&executable_path("just")) .current_dir(&subdir) - .args(&["--shell", "sh"]) + .args(["--shell", "sh"]) .output() .expect("just invocation failed"); diff --git a/tests/search.rs b/tests/search.rs index 395f3a9..c52a5cf 100644 --- a/tests/search.rs +++ b/tests/search.rs @@ -74,12 +74,12 @@ fn test_downwards_path_argument() { let path = tmp.path(); - search_test(&path, &["a/"]); - search_test(&path, &["a/default"]); - search_test(&path, &["./a/"]); - search_test(&path, &["./a/default"]); - search_test(&path, &["./a/"]); - search_test(&path, &["./a/default"]); + search_test(path, &["a/"]); + search_test(path, &["a/default"]); + search_test(path, &["./a/"]); + search_test(path, &["./a/default"]); + search_test(path, &["./a/"]); + search_test(path, &["./a/default"]); } #[test] @@ -111,12 +111,12 @@ fn test_downwards_multiple_path_argument() { let path = tmp.path(); - search_test(&path, &["a/b/"]); - search_test(&path, &["a/b/default"]); - search_test(&path, &["./a/b/"]); - search_test(&path, &["./a/b/default"]); - search_test(&path, &["./a/b/"]); - search_test(&path, &["./a/b/default"]); + search_test(path, &["a/b/"]); + search_test(path, &["a/b/default"]); + search_test(path, &["./a/b/"]); + search_test(path, &["./a/b/default"]); + search_test(path, &["./a/b/"]); + search_test(path, &["./a/b/default"]); } #[test] @@ -128,7 +128,7 @@ fn single_downards() { let path = tmp.path(); - search_test(&path, &["child/"]); + search_test(path, &["child/"]); } #[test] diff --git a/tests/test.rs b/tests/test.rs index a890930..00f7bad 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -179,7 +179,7 @@ impl Test { let mut command = Command::new(&executable_path("just")); if self.shell { - command.args(&["--shell", "bash"]); + command.args(["--shell", "bash"]); } let mut child = command diff --git a/tests/working_directory.rs b/tests/working_directory.rs index 28e5ffd..01409d9 100644 --- a/tests/working_directory.rs +++ b/tests/working_directory.rs @@ -53,7 +53,7 @@ fn justfile_without_working_directory_relative() -> Result<(), Box> { }; let output = Command::new(executable_path("just")) - .current_dir(&tmp.path()) + .current_dir(tmp.path()) .arg("--justfile") .arg("justfile") .output()?; @@ -138,7 +138,7 @@ fn search_dir_child() -> Result<(), Box> { }; let output = Command::new(executable_path("just")) - .current_dir(&tmp.path()) + .current_dir(tmp.path()) .arg("child/") .output()?;