From bcad76396be5a6074b2d0ffa098cf435907c558a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 21 Jul 2022 14:42:34 -0500 Subject: [PATCH] fix!: Remove ErrorKind::ArgumentNotFound This existed for `value_of_t` and isn't needed anymore --- src/error/kind.rs | 8 -------- src/error/mod.rs | 11 ----------- 2 files changed, 19 deletions(-) diff --git a/src/error/kind.rs b/src/error/kind.rs index 4c3dc48b..332c4ca1 100644 --- a/src/error/kind.rs +++ b/src/error/kind.rs @@ -374,13 +374,6 @@ pub enum ErrorKind { /// ``` DisplayVersion, - /// Occurs when using the [`ArgMatches::value_of_t`] and friends to convert an argument value - /// into type `T`, but the argument you requested wasn't used. I.e. you asked for an argument - /// with name `config` to be converted, but `config` wasn't used by the user. - /// - /// [`ArgMatches::value_of_t`]: crate::ArgMatches::value_of_t() - ArgumentNotFound, - /// Represents an [I/O error]. /// Can occur when writing to `stderr` or `stdout` or reading a configuration file. /// @@ -426,7 +419,6 @@ impl ErrorKind { Self::DisplayHelp => None, Self::DisplayHelpOnMissingArgumentOrSubcommand => None, Self::DisplayVersion => None, - Self::ArgumentNotFound => Some("An argument wasn't found"), Self::Io => None, Self::Format => None, } diff --git a/src/error/mod.rs b/src/error/mod.rs index a30419c9..c9cf8e3f 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -861,17 +861,6 @@ impl Error { false } } - ErrorKind::ArgumentNotFound => { - let invalid_arg = self.get_context(ContextKind::InvalidArg); - if let Some(ContextValue::String(invalid_arg)) = invalid_arg { - c.none("The argument '"); - c.warning(invalid_arg.to_string()); - c.none("' wasn't found"); - true - } else { - false - } - } ErrorKind::DisplayHelp | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand | ErrorKind::DisplayVersion