Auto merge of #7912 - matthiaskrgr:clippy_v11, r=ehuss

fix most remaining clippy findings (mostly redundant imports)
This commit is contained in:
bors 2020-02-21 20:20:10 +00:00
commit e57bd02999
18 changed files with 9 additions and 30 deletions

View file

@ -39,7 +39,6 @@ use some of the helper functions in this file to interact with the repository.
*/
use crate::{path2url, project, Project, ProjectBuilder};
use git2;
use std::fs::{self, File};
use std::io::prelude::*;
use std::path::{Path, PathBuf};

View file

@ -120,9 +120,7 @@ use std::str;
use std::time::{self, Duration};
use std::usize;
use cargo;
use cargo::util::{is_ci, CargoResult, ProcessBuilder, ProcessError, Rustc};
use filetime;
use serde_json::{self, Value};
use url::Url;

View file

@ -6,7 +6,6 @@ use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::str;
use cargo;
use cargo_test_support::cargo_process;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::registry::Package;

View file

@ -13,7 +13,6 @@ use cargo_test_support::git;
use cargo_test_support::install::{assert_has_installed_exe, cargo_home};
use cargo_test_support::registry::Package;
use cargo_test_support::{basic_manifest, execs, project, slow_cpu_multiplier};
use git2;
fn pkg(name: &str, vers: &str) {
Package::new(name, vers)

View file

@ -49,10 +49,10 @@ fn simple_cross() {
let target = cross_compile::alternate();
p.cargo("build -v --target").arg(&target).run();
assert!(p.target_bin(&target, "foo").is_file());
assert!(p.target_bin(target, "foo").is_file());
if cross_compile::can_run_on_host() {
p.process(&p.target_bin(&target, "foo")).run();
p.process(&p.target_bin(target, "foo")).run();
}
}
@ -110,10 +110,10 @@ fn simple_cross_config() {
let target = cross_compile::alternate();
p.cargo("build -v").run();
assert!(p.target_bin(&target, "foo").is_file());
assert!(p.target_bin(target, "foo").is_file());
if cross_compile::can_run_on_host() {
p.process(&p.target_bin(&target, "foo")).run();
p.process(&p.target_bin(target, "foo")).run();
}
}
@ -146,10 +146,10 @@ fn simple_deps() {
let target = cross_compile::alternate();
p.cargo("build --target").arg(&target).run();
assert!(p.target_bin(&target, "foo").is_file());
assert!(p.target_bin(target, "foo").is_file());
if cross_compile::can_run_on_host() {
p.process(&p.target_bin(&target, "foo")).run();
p.process(&p.target_bin(target, "foo")).run();
}
}

View file

@ -1,6 +1,5 @@
//! Tests for git support.
use git2;
use std::env;
use std::fs::{self, File};
use std::io::prelude::*;

View file

@ -10,7 +10,6 @@ use std::thread;
use cargo_test_support::paths;
use cargo_test_support::{basic_manifest, project};
use git2;
// Tests that HTTP auth is offered from `credential.helper`.
#[cargo_test]

View file

@ -9,7 +9,6 @@ use cargo_test_support::git;
use cargo_test_support::paths;
use cargo_test_support::project;
use cargo_test_support::registry::Package;
use git2;
use url::Url;

View file

@ -1,6 +1,5 @@
//! Tests for the `cargo init` command.
use cargo_test_support;
use std::env;
use std::fs::{self, File};
use std::io::prelude::*;

View file

@ -3,8 +3,6 @@
use std::fs::{self, File, OpenOptions};
use std::io::prelude::*;
use git2;
use cargo_test_support::cross_compile;
use cargo_test_support::git;
use cargo_test_support::install::{

View file

@ -9,7 +9,6 @@ use cargo::util::config::Config;
use cargo_test_support::install::cargo_home;
use cargo_test_support::registry::{self, registry_url};
use cargo_test_support::{cargo_process, paths, t};
use toml;
const TOKEN: &str = "test-token";
const TOKEN2: &str = "test-token2";

View file

@ -4,7 +4,7 @@ use cargo_test_support::{
basic_lib_manifest, basic_manifest, is_coarse_mtime, project, registry::Package, rustc_host,
Project,
};
use serde_json;
use std::str;
#[cargo_test]

View file

@ -9,12 +9,9 @@ use cargo_test_support::registry::{self, api_path, registry_url};
fn setup(name: &str, content: Option<&str>) {
let dir = api_path().join(format!("api/v1/crates/{}", name));
dir.mkdir_p();
match content {
Some(body) => {
if let Some(body) = content {
fs::write(dir.join("owners"), body).unwrap();
}
None => {}
}
}
#[cargo_test]

View file

@ -1,6 +1,5 @@
//! Tests for the `cargo package` command.
use std;
use std::fs::{read_to_string, File};
use std::io::prelude::*;
use std::path::Path;
@ -11,7 +10,6 @@ use cargo_test_support::{
basic_manifest, cargo_process, git, path2url, paths, project, publish::validate_crate_contents,
registry, symlink_supported, t,
};
use git2;
#[cargo_test]
fn simple() {

View file

@ -7,7 +7,6 @@ use cargo_test_support::git;
use cargo_test_support::paths;
use cargo_test_support::registry::Package;
use cargo_test_support::{basic_manifest, project, t};
use toml;
#[cargo_test]
fn replace() {

View file

@ -1,6 +1,5 @@
//! Tests for including `Cargo.lock` when publishing/packaging.
use std;
use std::fs::File;
use cargo_test_support::registry::Package;

View file

@ -1,6 +1,5 @@
//! Tests for the `cargo test` command.
use cargo;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::registry::Package;
use cargo_test_support::{

View file

@ -1,6 +1,5 @@
//! Tests for displaying the cargo version.
use cargo;
use cargo_test_support::project;
#[cargo_test]