From 64c69dffc570c72af21dd444c940416f40e1daa1 Mon Sep 17 00:00:00 2001 From: l00556901 Date: Wed, 1 Dec 2021 11:02:31 +0800 Subject: [PATCH] fix some bugs --- src/cargo/util/command_prelude.rs | 2 +- tests/testsuite/login.rs | 9 +-------- tests/testsuite/publish.rs | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index 5875db02ab2..3afb9563b06 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -614,7 +614,7 @@ pub trait ArgMatchesExt { } fn index(&self) -> CargoResult> { - let index = self._value_of("index").map(|s| s.to_string()); + let index = self._value_of("index").map(|s| s.to_string()); Ok(index) } diff --git a/tests/testsuite/login.rs b/tests/testsuite/login.rs index eddeecb3421..b69616ff81b 100644 --- a/tests/testsuite/login.rs +++ b/tests/testsuite/login.rs @@ -1,9 +1,7 @@ //! Tests for the `cargo login` command. -use cargo::core::Shell; -use cargo::util::config::Config; use cargo_test_support::install::cargo_home; -use cargo_test_support::registry::{self, registry_url}; +use cargo_test_support::registry; use cargo_test_support::{cargo_process, paths, t}; use std::fs::{self, OpenOptions}; use std::io::prelude::*; @@ -18,11 +16,6 @@ fn setup_new_credentials() { setup_new_credentials_at(config); } -fn setup_new_credentials_toml() { - let config = cargo_home().join("credentials.toml"); - setup_new_credentials_at(config); -} - fn setup_new_credentials_at(config: PathBuf) { t!(fs::create_dir_all(config.parent().unwrap())); t!(fs::write( diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index 1e4345b6f1c..9fdf4defffe 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -2,7 +2,7 @@ use cargo_test_support::git::{self, repo}; use cargo_test_support::paths; -use cargo_test_support::registry::{self, registry_path, registry_url, Package}; +use cargo_test_support::registry::{self, registry_url, Package}; use cargo_test_support::{basic_manifest, no_such_file_err_msg, project, publish}; use std::fs;