From 428a075e4187db5084aa5424552b75bf25e99a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 25 Mar 2020 11:58:39 +0100 Subject: [PATCH] remove redundant imports and clone (found by clippy) --- src/build/arg/mod.rs | 2 -- src/build/arg_group.rs | 4 ---- src/output/fmt.rs | 2 -- src/output/help.rs | 4 ---- src/parse/arg_matcher.rs | 3 --- src/parse/errors.rs | 6 +----- src/parse/features/suggestions.rs | 4 ---- 7 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/build/arg/mod.rs b/src/build/arg/mod.rs index 55b4dcf9..892dc989 100644 --- a/src/build/arg/mod.rs +++ b/src/build/arg/mod.rs @@ -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}; diff --git a/src/build/arg_group.rs b/src/build/arg_group.rs index 789dc276..b3a89bb7 100644 --- a/src/build/arg_group.rs +++ b/src/build/arg_group.rs @@ -1,10 +1,6 @@ // Std use std::fmt::{Debug, Formatter, Result}; -// Third Party -#[cfg(feature = "yaml")] -use yaml_rust; - // Internal use crate::util::Key; diff --git a/src/output/fmt.rs b/src/output/fmt.rs index 4f8e324d..d36625c6 100644 --- a/src/output/fmt.rs +++ b/src/output/fmt.rs @@ -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; diff --git a/src/output/help.rs b/src/output/help.rs index 4a29d323..1d2cf6ef 100644 --- a/src/output/help.rs +++ b/src/output/help.rs @@ -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"))] diff --git a/src/parse/arg_matcher.rs b/src/parse/arg_matcher.rs index 9303024b..f0fcbd10 100644 --- a/src/parse/arg_matcher.rs +++ b/src/parse/arg_matcher.rs @@ -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}; diff --git a/src/parse/errors.rs b/src/parse/errors.rs index e48d1b11..9f9f2441 100644 --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -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]), } diff --git a/src/parse/features/suggestions.rs b/src/parse/features/suggestions.rs index 25a33ffd..3e62467b 100644 --- a/src/parse/features/suggestions.rs +++ b/src/parse/features/suggestions.rs @@ -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;