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 {
let output = Command::new(executable_path("ref-type"))
.args(&["--reference", reference])
.args(["--reference", reference])
.output()
.unwrap();

View File

@ -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),
])

View File

@ -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<String, String>,
search: &Search,
settings: &Settings,
ran: &mut BTreeSet<Vec<String>>,
) -> 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::<Vec<&str>>(),
dotenv,
search,
settings,
ran,
)?;
}
@ -351,7 +341,6 @@ impl<'src> Justfile<'src> {
&evaluated.iter().map(String::as_ref).collect::<Vec<&str>>(),
dotenv,
search,
settings,
&mut ran,
)?;
}

View File

@ -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();

View File

@ -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");

View File

@ -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]

View File

@ -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

View File

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