Skip to content

Commit 108e90c

Browse files
committed
Auto merge of #75795 - matthiaskrgr:cargotest_clippy, r=Dylan-DPC
cargotest: fix clippy warnings Fixes clippy::redundant_static_lifetimes and clippy::toplevel_ref_arg I also replaced some .expect("") calls with .unwrap()s since there was no message passed by the .expect() anyway.
2 parents c5a8b7b + 69f9639 commit 108e90c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/tools/cargotest/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct Test {
1111
packages: &'static [&'static str],
1212
}
1313

14-
const TEST_REPOS: &'static [Test] = &[
14+
const TEST_REPOS: &[Test] = &[
1515
Test {
1616
name: "iron",
1717
repo: "https://github.com/iron/iron",
@@ -53,9 +53,9 @@ const TEST_REPOS: &'static [Test] = &[
5353

5454
fn main() {
5555
let args = env::args().collect::<Vec<_>>();
56-
let ref cargo = args[1];
56+
let cargo = &args[1];
5757
let out_dir = Path::new(&args[2]);
58-
let ref cargo = Path::new(cargo);
58+
let cargo = &Path::new(cargo);
5959

6060
for test in TEST_REPOS.iter().rev() {
6161
test_repo(cargo, out_dir, test);
@@ -77,7 +77,7 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
7777
let out_dir = out_dir.join(test.name);
7878

7979
if !out_dir.join(".git").is_dir() {
80-
let status = Command::new("git").arg("init").arg(&out_dir).status().expect("");
80+
let status = Command::new("git").arg("init").arg(&out_dir).status().unwrap();
8181
assert!(status.success());
8282
}
8383

@@ -92,7 +92,7 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
9292
.arg(&format!("--depth={}", depth))
9393
.current_dir(&out_dir)
9494
.status()
95-
.expect("");
95+
.unwrap();
9696
assert!(status.success());
9797
}
9898

@@ -102,7 +102,7 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
102102
.arg("--hard")
103103
.current_dir(&out_dir)
104104
.status()
105-
.expect("");
105+
.unwrap();
106106

107107
if status.success() {
108108
found = true;
@@ -133,7 +133,7 @@ fn run_cargo_test(cargo_path: &Path, crate_path: &Path, packages: &[&str]) -> bo
133133
.env("RUSTFLAGS", "--cap-lints warn")
134134
.current_dir(crate_path)
135135
.status()
136-
.expect("");
136+
.unwrap();
137137

138138
status.success()
139139
}

0 commit comments

Comments
 (0)