Skip to content

Commit

Permalink
Placate clippy (casey#1423)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Nov 23, 2022
1 parent 2b46af1 commit e7b7897
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 33 deletions.
2 changes: 1 addition & 1 deletion bin/ref-type/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion bin/update-contributors/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
])
Expand Down
13 changes: 1 addition & 12 deletions src/justfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand All @@ -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()];
Expand Down Expand Up @@ -328,7 +319,6 @@ impl<'src> Justfile<'src> {
&arguments.iter().map(String::as_ref).collect::<Vec<&str>>(),
dotenv,
search,
settings,
ran,
)?;
}
Expand All @@ -351,7 +341,6 @@ impl<'src> Justfile<'src> {
&evaluated.iter().map(String::as_ref).collect::<Vec<&str>>(),
dotenv,
search,
settings,
&mut ran,
)?;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion tests/invocation_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
26 changes: 13 additions & 13 deletions tests/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -128,7 +128,7 @@ fn single_downards() {

let path = tmp.path();

search_test(&path, &["child/"]);
search_test(path, &["child/"]);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/working_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down Expand Up @@ -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()?;

Expand Down

0 comments on commit e7b7897

Please sign in to comment.