Placate clippy (#1423)

This commit is contained in:
Casey Rodarmor 2022-11-22 16:36:23 -08:00 committed by GitHub
parent 2b46af1cae
commit e7b7897ae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 33 deletions

View File

@ -3,7 +3,7 @@ use std::{process::Command, str};
fn stdout(reference: &str) -> String { fn stdout(reference: &str) -> String {
let output = Command::new(executable_path("ref-type")) let output = Command::new(executable_path("ref-type"))
.args(&["--reference", reference]) .args(["--reference", reference])
.output() .output()
.unwrap(); .unwrap();

View File

@ -6,7 +6,7 @@ use {
fn author(pr: u64) -> String { fn author(pr: u64) -> String {
eprintln!("#{}", pr); eprintln!("#{}", pr);
let output = Command::new("sh") let output = Command::new("sh")
.args(&[ .args([
"-c", "-c",
&format!("gh pr view {} --json author | jq -r .author.login", pr), &format!("gh pr view {} --json author | jq -r .author.login", pr),
]) ])

View File

@ -257,15 +257,7 @@ impl<'src> Justfile<'src> {
let mut ran = BTreeSet::new(); let mut ran = BTreeSet::new();
for (recipe, arguments) in grouped { for (recipe, arguments) in grouped {
Self::run_recipe( Self::run_recipe(&context, recipe, arguments, &dotenv, search, &mut ran)?;
&context,
recipe,
arguments,
&dotenv,
search,
&self.settings,
&mut ran,
)?;
} }
Ok(()) Ok(())
@ -289,7 +281,6 @@ impl<'src> Justfile<'src> {
arguments: &[&str], arguments: &[&str],
dotenv: &BTreeMap<String, String>, dotenv: &BTreeMap<String, String>,
search: &Search, search: &Search,
settings: &Settings,
ran: &mut BTreeSet<Vec<String>>, ran: &mut BTreeSet<Vec<String>>,
) -> RunResult<'src, ()> { ) -> RunResult<'src, ()> {
let mut invocation = vec![recipe.name().to_owned()]; let mut invocation = vec![recipe.name().to_owned()];
@ -328,7 +319,6 @@ impl<'src> Justfile<'src> {
&arguments.iter().map(String::as_ref).collect::<Vec<&str>>(), &arguments.iter().map(String::as_ref).collect::<Vec<&str>>(),
dotenv, dotenv,
search, search,
settings,
ran, ran,
)?; )?;
} }
@ -351,7 +341,6 @@ impl<'src> Justfile<'src> {
&evaluated.iter().map(String::as_ref).collect::<Vec<&str>>(), &evaluated.iter().map(String::as_ref).collect::<Vec<&str>>(),
dotenv, dotenv,
search, search,
settings,
&mut ran, &mut ran,
)?; )?;
} }

View File

@ -106,7 +106,7 @@ fn working_directory_is_correct() {
fs::create_dir(tmp.path().join("foo")).unwrap(); fs::create_dir(tmp.path().join("foo")).unwrap();
let output = Command::new(&executable_path("just")) let output = Command::new(&executable_path("just"))
.args(&["--command", "cat", "bar"]) .args(["--command", "cat", "bar"])
.current_dir(tmp.path().join("foo")) .current_dir(tmp.path().join("foo"))
.output() .output()
.unwrap(); .unwrap();
@ -125,7 +125,7 @@ fn command_not_found() {
fs::write(tmp.path().join("justfile"), "").unwrap(); fs::write(tmp.path().join("justfile"), "").unwrap();
let output = Command::new(&executable_path("just")) let output = Command::new(&executable_path("just"))
.args(&["--command", "asdfasdfasdfasdfadfsadsfadsf", "bar"]) .args(["--command", "asdfasdfasdfasdfadfsadsfadsf", "bar"])
.output() .output()
.unwrap(); .unwrap();

View File

@ -50,7 +50,7 @@ fn test_invocation_directory() {
let output = Command::new(&executable_path("just")) let output = Command::new(&executable_path("just"))
.current_dir(&subdir) .current_dir(&subdir)
.args(&["--shell", "sh"]) .args(["--shell", "sh"])
.output() .output()
.expect("just invocation failed"); .expect("just invocation failed");

View File

@ -74,12 +74,12 @@ fn test_downwards_path_argument() {
let path = tmp.path(); let path = tmp.path();
search_test(&path, &["a/"]); search_test(path, &["a/"]);
search_test(&path, &["a/default"]); search_test(path, &["a/default"]);
search_test(&path, &["./a/"]); search_test(path, &["./a/"]);
search_test(&path, &["./a/default"]); search_test(path, &["./a/default"]);
search_test(&path, &["./a/"]); search_test(path, &["./a/"]);
search_test(&path, &["./a/default"]); search_test(path, &["./a/default"]);
} }
#[test] #[test]
@ -111,12 +111,12 @@ fn test_downwards_multiple_path_argument() {
let path = tmp.path(); let path = tmp.path();
search_test(&path, &["a/b/"]); search_test(path, &["a/b/"]);
search_test(&path, &["a/b/default"]); search_test(path, &["a/b/default"]);
search_test(&path, &["./a/b/"]); search_test(path, &["./a/b/"]);
search_test(&path, &["./a/b/default"]); search_test(path, &["./a/b/default"]);
search_test(&path, &["./a/b/"]); search_test(path, &["./a/b/"]);
search_test(&path, &["./a/b/default"]); search_test(path, &["./a/b/default"]);
} }
#[test] #[test]
@ -128,7 +128,7 @@ fn single_downards() {
let path = tmp.path(); let path = tmp.path();
search_test(&path, &["child/"]); search_test(path, &["child/"]);
} }
#[test] #[test]

View File

@ -179,7 +179,7 @@ impl Test {
let mut command = Command::new(&executable_path("just")); let mut command = Command::new(&executable_path("just"));
if self.shell { if self.shell {
command.args(&["--shell", "bash"]); command.args(["--shell", "bash"]);
} }
let mut child = command let mut child = command

View File

@ -53,7 +53,7 @@ fn justfile_without_working_directory_relative() -> Result<(), Box<dyn Error>> {
}; };
let output = Command::new(executable_path("just")) let output = Command::new(executable_path("just"))
.current_dir(&tmp.path()) .current_dir(tmp.path())
.arg("--justfile") .arg("--justfile")
.arg("justfile") .arg("justfile")
.output()?; .output()?;
@ -138,7 +138,7 @@ fn search_dir_child() -> Result<(), Box<dyn Error>> {
}; };
let output = Command::new(executable_path("just")) let output = Command::new(executable_path("just"))
.current_dir(&tmp.path()) .current_dir(tmp.path())
.arg("child/") .arg("child/")
.output()?; .output()?;