mirror of
https://github.com/clap-rs/clap
synced 2024-12-12 13:52:34 +00:00
Merge pull request #3816 from epage/dep
docs(parser): Encourage people to read the whole deprecation message
This commit is contained in:
commit
8bb3853eb5
4 changed files with 10 additions and 10 deletions
|
@ -521,11 +521,11 @@ impl ArgMatches {
|
|||
self.values_of_t(name).unwrap_or_else(|e| e.exit())
|
||||
}
|
||||
|
||||
/// Deprecated, replaced with [`ArgMatches::contains_id`] or
|
||||
/// [`ArgAction::SetTrue`][crate::ArgAction].
|
||||
/// Deprecated, replaced with [`ArgAction::SetTrue`][crate::ArgAction] or
|
||||
/// [`ArgMatches::contains_id`].
|
||||
#[deprecated(
|
||||
since = "3.2.0",
|
||||
note = "Replaced with either `ArgMatches::contains_id(...)` or `ArgAction::SetTrue`"
|
||||
note = "Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`"
|
||||
)]
|
||||
pub fn is_present<T: Key>(&self, id: T) -> bool {
|
||||
let id = Id::from(id);
|
||||
|
@ -565,11 +565,11 @@ impl ArgMatches {
|
|||
value.and_then(MatchedArg::source)
|
||||
}
|
||||
|
||||
/// Deprecated, replaced with [`ArgMatches::get_many`]`.len()` or
|
||||
/// [`ArgAction::Count`][crate::ArgAction].
|
||||
/// Deprecated, replaced with [`ArgAction::Count`][crate::ArgAction] or
|
||||
/// [`ArgMatches::get_many`]`.len()`.
|
||||
#[deprecated(
|
||||
since = "3.2.0",
|
||||
note = "Replaced with either `ArgMatches::get_many(...).len()` or `ArgAction::Count`"
|
||||
note = "Replaced with either `ArgAction::Count` or `ArgMatches::get_many(...).len()`"
|
||||
)]
|
||||
pub fn occurrences_of<T: Key>(&self, id: T) -> u64 {
|
||||
#![allow(deprecated)]
|
||||
|
|
|
@ -35,7 +35,7 @@ help: `bool` is a unit variant, you need to write it without the parenthesis
|
|||
7 | opts: bool,
|
||||
| ~~~~
|
||||
|
||||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgMatches::contains_id(...)` or `ArgAction::SetTrue`
|
||||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
|
||||
--> tests/derive_ui/next/bool_value_enum.rs:7:11
|
||||
|
|
||||
7 | opts: bool,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgMatches::contains_id(...)` or `ArgAction::SetTrue`
|
||||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
|
||||
--> tests/derive_ui/non_existent_attr.rs:15:12
|
||||
|
|
||||
15 | debug: bool,
|
||||
|
@ -6,7 +6,7 @@ warning: use of deprecated associated function `clap::ArgMatches::is_present`: R
|
|||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgMatches::contains_id(...)` or `ArgAction::SetTrue`
|
||||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
|
||||
--> tests/derive_ui/non_existent_attr.rs:15:12
|
||||
|
|
||||
15 | debug: bool,
|
||||
|
|
|
@ -35,7 +35,7 @@ help: `bool` is a unit variant, you need to write it without the parenthesis
|
|||
7 | opts: bool,
|
||||
| ~~~~
|
||||
|
||||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgMatches::contains_id(...)` or `ArgAction::SetTrue`
|
||||
warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
|
||||
--> tests/derive_ui/stable/bool_value_enum.rs:7:11
|
||||
|
|
||||
7 | opts: bool,
|
||||
|
|
Loading…
Reference in a new issue