fix!: Remove ErrorKind::ArgumentNotFound

This existed for `value_of_t` and isn't needed anymore
This commit is contained in:
Ed Page 2022-07-21 14:42:34 -05:00
parent 75ebeca6d8
commit bcad76396b
2 changed files with 0 additions and 19 deletions

View file

@ -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,
}

View file

@ -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