Skip to content

Commit 1d91200

Browse files
committed
fix most remaining clippy findings (mostly redundant imports)
1 parent abc8463 commit 1d91200

18 files changed

+9
-30
lines changed

crates/cargo-test-support/src/git.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use some of the helper functions in this file to interact with the repository.
3939
*/
4040

4141
use crate::{path2url, project, Project, ProjectBuilder};
42-
use git2;
4342
use std::fs::{self, File};
4443
use std::io::prelude::*;
4544
use std::path::{Path, PathBuf};

crates/cargo-test-support/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ use std::str;
120120
use std::time::{self, Duration};
121121
use std::usize;
122122

123-
use cargo;
124123
use cargo::util::{is_ci, CargoResult, ProcessBuilder, ProcessError, Rustc};
125-
use filetime;
126124
use serde_json::{self, Value};
127125
use url::Url;
128126

tests/testsuite/cargo_command.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::io::prelude::*;
66
use std::path::{Path, PathBuf};
77
use std::str;
88

9-
use cargo;
109
use cargo_test_support::cargo_process;
1110
use cargo_test_support::paths::{self, CargoPathExt};
1211
use cargo_test_support::registry::Package;

tests/testsuite/concurrent.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use cargo_test_support::git;
1313
use cargo_test_support::install::{assert_has_installed_exe, cargo_home};
1414
use cargo_test_support::registry::Package;
1515
use cargo_test_support::{basic_manifest, execs, project, slow_cpu_multiplier};
16-
use git2;
1716

1817
fn pkg(name: &str, vers: &str) {
1918
Package::new(name, vers)

tests/testsuite/cross_compile.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ fn simple_cross() {
4949

5050
let target = cross_compile::alternate();
5151
p.cargo("build -v --target").arg(&target).run();
52-
assert!(p.target_bin(&target, "foo").is_file());
52+
assert!(p.target_bin(target, "foo").is_file());
5353

5454
if cross_compile::can_run_on_host() {
55-
p.process(&p.target_bin(&target, "foo")).run();
55+
p.process(&p.target_bin(target, "foo")).run();
5656
}
5757
}
5858

@@ -110,10 +110,10 @@ fn simple_cross_config() {
110110

111111
let target = cross_compile::alternate();
112112
p.cargo("build -v").run();
113-
assert!(p.target_bin(&target, "foo").is_file());
113+
assert!(p.target_bin(target, "foo").is_file());
114114

115115
if cross_compile::can_run_on_host() {
116-
p.process(&p.target_bin(&target, "foo")).run();
116+
p.process(&p.target_bin(target, "foo")).run();
117117
}
118118
}
119119

@@ -146,10 +146,10 @@ fn simple_deps() {
146146

147147
let target = cross_compile::alternate();
148148
p.cargo("build --target").arg(&target).run();
149-
assert!(p.target_bin(&target, "foo").is_file());
149+
assert!(p.target_bin(target, "foo").is_file());
150150

151151
if cross_compile::can_run_on_host() {
152-
p.process(&p.target_bin(&target, "foo")).run();
152+
p.process(&p.target_bin(target, "foo")).run();
153153
}
154154
}
155155

tests/testsuite/git.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Tests for git support.
22
3-
use git2;
43
use std::env;
54
use std::fs::{self, File};
65
use std::io::prelude::*;

tests/testsuite/git_auth.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::thread;
1010

1111
use cargo_test_support::paths;
1212
use cargo_test_support::{basic_manifest, project};
13-
use git2;
1413

1514
// Tests that HTTP auth is offered from `credential.helper`.
1615
#[cargo_test]

tests/testsuite/git_gc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use cargo_test_support::git;
99
use cargo_test_support::paths;
1010
use cargo_test_support::project;
1111
use cargo_test_support::registry::Package;
12-
use git2;
1312

1413
use url::Url;
1514

tests/testsuite/init.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Tests for the `cargo init` command.
22
3-
use cargo_test_support;
43
use std::env;
54
use std::fs::{self, File};
65
use std::io::prelude::*;

tests/testsuite/install.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
use std::fs::{self, File, OpenOptions};
44
use std::io::prelude::*;
55

6-
use git2;
7-
86
use cargo_test_support::cross_compile;
97
use cargo_test_support::git;
108
use cargo_test_support::install::{

tests/testsuite/login.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use cargo::util::config::Config;
99
use cargo_test_support::install::cargo_home;
1010
use cargo_test_support::registry::{self, registry_url};
1111
use cargo_test_support::{cargo_process, paths, t};
12-
use toml;
1312

1413
const TOKEN: &str = "test-token";
1514
const TOKEN2: &str = "test-token2";

tests/testsuite/metabuild.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use cargo_test_support::{
44
basic_lib_manifest, basic_manifest, is_coarse_mtime, project, registry::Package, rustc_host,
55
Project,
66
};
7-
use serde_json;
7+
88
use std::str;
99

1010
#[cargo_test]

tests/testsuite/owner.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ use cargo_test_support::registry::{self, api_path, registry_url};
99
fn setup(name: &str, content: Option<&str>) {
1010
let dir = api_path().join(format!("api/v1/crates/{}", name));
1111
dir.mkdir_p();
12-
match content {
13-
Some(body) => {
14-
fs::write(dir.join("owners"), body).unwrap();
15-
}
16-
None => {}
12+
if let Some(body) = content {
13+
fs::write(dir.join("owners"), body).unwrap();
1714
}
1815
}
1916

tests/testsuite/package.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Tests for the `cargo package` command.
22
3-
use std;
43
use std::fs::{read_to_string, File};
54
use std::io::prelude::*;
65
use std::path::Path;
@@ -11,7 +10,6 @@ use cargo_test_support::{
1110
basic_manifest, cargo_process, git, path2url, paths, project, publish::validate_crate_contents,
1211
registry, symlink_supported, t,
1312
};
14-
use git2;
1513

1614
#[cargo_test]
1715
fn simple() {

tests/testsuite/patch.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use cargo_test_support::git;
77
use cargo_test_support::paths;
88
use cargo_test_support::registry::Package;
99
use cargo_test_support::{basic_manifest, project, t};
10-
use toml;
1110

1211
#[cargo_test]
1312
fn replace() {

tests/testsuite/publish_lockfile.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Tests for including `Cargo.lock` when publishing/packaging.
22
3-
use std;
43
use std::fs::File;
54

65
use cargo_test_support::registry::Package;

tests/testsuite/test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Tests for the `cargo test` command.
22
3-
use cargo;
43
use cargo_test_support::paths::CargoPathExt;
54
use cargo_test_support::registry::Package;
65
use cargo_test_support::{

tests/testsuite/version.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Tests for displaying the cargo version.
22
3-
use cargo;
43
use cargo_test_support::project;
54

65
#[cargo_test]

0 commit comments

Comments
 (0)