mirror of
https://github.com/rust-lang/cargo
synced 2024-10-02 05:53:53 +00:00
Auto merge of #7912 - matthiaskrgr:clippy_v11, r=ehuss
fix most remaining clippy findings (mostly redundant imports)
This commit is contained in:
commit
e57bd02999
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
//! Tests for git support.
|
||||
|
||||
use git2;
|
||||
use std::env;
|
||||
use std::fs::{self, File};
|
||||
use std::io::prelude::*;
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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::*;
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -9,11 +9,8 @@ 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) => {
|
||||
fs::write(dir.join("owners"), body).unwrap();
|
||||
}
|
||||
None => {}
|
||||
if let Some(body) = content {
|
||||
fs::write(dir.join("owners"), body).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
//! Tests for including `Cargo.lock` when publishing/packaging.
|
||||
|
||||
use std;
|
||||
use std::fs::File;
|
||||
|
||||
use cargo_test_support::registry::Package;
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
//! Tests for displaying the cargo version.
|
||||
|
||||
use cargo;
|
||||
use cargo_test_support::project;
|
||||
|
||||
#[cargo_test]
|
||||
|
|
Loading…
Reference in a new issue