1760: remove redundant imports and clone (found by clippy) r=pksunkara a=matthiaskrgr



Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
This commit is contained in:
bors[bot] 2020-03-25 13:07:40 +00:00 committed by GitHub
commit d8434ec925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 1 additions and 24 deletions

View file

@ -17,8 +17,6 @@ use std::str;
// Third Party
use crate::util::VecMap;
#[cfg(feature = "yaml")]
use yaml_rust;
// Internal
use crate::build::{arg::settings::ArgFlags, usage_parser::UsageParser};

View file

@ -1,10 +1,6 @@
// Std
use std::fmt::{Debug, Formatter, Result};
// Third Party
#[cfg(feature = "yaml")]
use yaml_rust;
// Internal
use crate::util::Key;

View file

@ -4,8 +4,6 @@ use ansi_term::ANSIString;
#[cfg(all(feature = "color", not(target_os = "windows")))]
use ansi_term::Colour::{Green, Red, Yellow};
#[cfg(feature = "color")]
use atty;
use std::env;
use std::fmt;

View file

@ -14,10 +14,6 @@ use crate::parse::Parser;
use crate::util::VecMap;
use crate::INTERNAL_ERROR_MSG;
// Third Party
#[cfg(feature = "wrap_help")]
use term_size;
use textwrap;
use unicode_width::UnicodeWidthStr;
#[cfg(not(feature = "wrap_help"))]

View file

@ -4,9 +4,6 @@ use std::ffi::OsStr;
use std::mem;
use std::ops::Deref;
// Third Party
use indexmap;
// Internal
use crate::build::{Arg, ArgSettings};
use crate::parse::{ArgMatches, MatchedArg, SubCommand};

View file

@ -1004,11 +1004,7 @@ impl Error {
});
Error {
cause: format!("The argument '{}' wasn't found", a),
message: format!(
"{} The argument '{}' wasn't found",
c.error("error:"),
a.clone()
),
message: format!("{} The argument '{}' wasn't found", c.error("error:"), a),
kind: ErrorKind::ArgumentNotFound,
info: Some(vec![a]),
}

View file

@ -1,10 +1,6 @@
#[cfg(feature = "suggestions")]
use std::cmp::Ordering;
// Third Party
#[cfg(feature = "suggestions")]
use strsim;
// Internal
use crate::build::App;
use crate::output::fmt::Format;