Skip to content

Commit 94e0694

Browse files
committed
cargo clippy fix
1 parent 0325ebf commit 94e0694

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

tests/basic.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn straightforward() {
2828
git_file_commit("b", &td);
2929
git(&["checkout", "-b", "changes", "HEAD~"], &td);
3030
for n in &["c", "d", "e"] {
31-
git_file_commit(&n, &td);
31+
git_file_commit(n, &td);
3232
}
3333

3434
let out = git_log(&td);
@@ -49,7 +49,7 @@ fn straightforward() {
4949
td.child("new").touch().unwrap();
5050
git(&["add", "new"], &td);
5151

52-
fixup(&td).args(&["-P", "d"]).output().unwrap();
52+
fixup(&td).args(["-P", "d"]).output().unwrap();
5353

5454
let shown = git_out(
5555
&["diff-tree", "--no-commit-id", "--name-only", "-r", ":/d"],
@@ -103,11 +103,11 @@ fn uses_merge_base_for_all_defaults() {
103103
// default
104104
td.child("new").touch().unwrap();
105105
git(&["add", "new"], &td);
106-
fixup(&td).args(&["-P", "b"]).assert().failure();
106+
fixup(&td).args(["-P", "b"]).assert().failure();
107107
// commits *after* the merge base of a default branch *do* get found by default
108108
git(&["reset", "HEAD~"], &td);
109109
git(&["add", "new"], &td);
110-
fixup(&td).args(&["-P", "f"]).assert().success();
110+
fixup(&td).args(["-P", "f"]).assert().success();
111111
}
112112
}
113113

@@ -137,7 +137,7 @@ fn simple_straightline_commits() {
137137
td.child("new").touch().unwrap();
138138
git(&["add", "new"], &td);
139139

140-
fixup(&td).args(&["-P", "target"]).assert().success();
140+
fixup(&td).args(["-P", "target"]).assert().success();
141141

142142
let (files, err) = git_changed_files("target", &td);
143143

@@ -185,7 +185,7 @@ fn stashes_before_rebase() {
185185
let tracked_changed_files = git_worktree_changed_files(&td);
186186
assert_eq!(tracked_changed_files.trim(), edited_file);
187187

188-
fixup(&td).args(&["-P", "target"]).assert().success();
188+
fixup(&td).args(["-P", "target"]).assert().success();
189189

190190
let (files, err) = git_changed_files("target", &td);
191191

@@ -235,7 +235,7 @@ fn test_no_commit_in_range() {
235235
td.child("new").touch().unwrap();
236236
git(&["add", "new"], &td);
237237

238-
let assertion = fixup(&td).args(&["-P", "b"]).assert().failure();
238+
let assertion = fixup(&td).args(["-P", "b"]).assert().failure();
239239
let out = string(assertion.get_output().stdout.clone());
240240
let expected = "No commit contains the pattern";
241241
assert!(
@@ -245,7 +245,7 @@ fn test_no_commit_in_range() {
245245
out
246246
);
247247

248-
fixup(&td).args(&["-P", "target"]).assert().success();
248+
fixup(&td).args(["-P", "target"]).assert().success();
249249

250250
let (files, err) = git_changed_files("target", &td);
251251

@@ -288,7 +288,7 @@ fn retarget_branches_in_range() {
288288
td.child("new").touch().unwrap();
289289
git(&["add", "new"], &td);
290290

291-
fixup(&td).args(&["-P", "target"]).assert().success();
291+
fixup(&td).args(["-P", "target"]).assert().success();
292292

293293
let (files, err) = git_changed_files("target", &td);
294294

@@ -339,7 +339,7 @@ fn retarget_branch_target_of_edit() {
339339
td.child("new").touch().unwrap();
340340
git(&["add", "new"], &td);
341341

342-
fixup(&td).args(&["-P", "target"]).assert().success();
342+
fixup(&td).args(["-P", "target"]).assert().success();
343343

344344
let out = git_log(&td);
345345
assert_eq!(
@@ -370,7 +370,7 @@ new
370370

371371
fn git_commits(ids: &[&str], tempdir: &assert_fs::TempDir) {
372372
for n in ids {
373-
git_file_commit(n, &tempdir);
373+
git_file_commit(n, tempdir);
374374
}
375375
}
376376

@@ -379,16 +379,16 @@ fn git_init(tempdir: &assert_fs::TempDir) {
379379
}
380380

381381
fn git_init_default_branch_name(name: &str, tempdir: &assert_fs::TempDir) {
382-
git(&["init", "--initial-branch", name], &tempdir);
383-
git(&["config", "user.email", "[email protected]"], &tempdir);
384-
git(&["config", "user.name", "nobody"], &tempdir);
382+
git(&["init", "--initial-branch", name], tempdir);
383+
git(&["config", "user.email", "[email protected]"], tempdir);
384+
git(&["config", "user.name", "nobody"], tempdir);
385385
}
386386

387387
/// Create a file and commit it with a mesage that is just the name of the file
388388
fn git_file_commit(name: &str, tempdir: &assert_fs::TempDir) {
389389
tempdir.child(format!("file_{}", name)).touch().unwrap();
390-
git(&["add", "-A"], &tempdir);
391-
git(&["commit", "-m", &name], &tempdir);
390+
git(&["add", "-A"], tempdir);
391+
git(&["commit", "-m", &name], tempdir);
392392
}
393393

394394
/// Get the git shown output for the target commit
@@ -401,7 +401,7 @@ fn git_changed_files(name: &str, tempdir: &assert_fs::TempDir) -> (String, Strin
401401
"-r",
402402
&format!(":/{}", name),
403403
],
404-
&tempdir,
404+
tempdir,
405405
);
406406
(string(out.stdout), string(out.stderr))
407407
}
@@ -421,7 +421,7 @@ fn git_out(args: &[&str], tempdir: &assert_fs::TempDir) -> Output {
421421

422422
fn git_log(tempdir: &assert_fs::TempDir) -> String {
423423
let mut s = String::from_utf8(
424-
git_inner(&["log", "--all", "--format=%s %D", "--graph"], &tempdir)
424+
git_inner(&["log", "--all", "--format=%s %D", "--graph"], tempdir)
425425
.output()
426426
.unwrap()
427427
.stdout,
@@ -430,7 +430,7 @@ fn git_log(tempdir: &assert_fs::TempDir) -> String {
430430
.lines()
431431
.map(|l| l.trim_end())
432432
.join("\n");
433-
s.push_str("\n");
433+
s.push('\n');
434434
s
435435
}
436436

@@ -440,14 +440,14 @@ fn string(from: Vec<u8>) -> String {
440440

441441
fn git_inner(args: &[&str], tempdir: &assert_fs::TempDir) -> Command {
442442
let mut cmd = Command::new("git");
443-
cmd.args(args).current_dir(&tempdir.path());
443+
cmd.args(args).current_dir(tempdir.path());
444444
cmd
445445
}
446446

447447
/// Get something that can get args added to it
448448
fn fixup(dir: &assert_fs::TempDir) -> Command {
449449
let mut c = Command::cargo_bin("git-instafix").unwrap();
450-
c.current_dir(&dir.path())
450+
c.current_dir(dir.path())
451451
.env_remove("GIT_INSTAFIX_UPSTREAM");
452452
c
453453
}

0 commit comments

Comments
 (0)