mirror of
https://github.com/clap-rs/clap
synced 2024-09-20 14:31:58 +00:00
fix(derive): Ensure clap/structopt attributes still work
The problem with updating all code to use non-deprecated APIs, there aren't tests for the old way anymore. Fixes #4274
This commit is contained in:
parent
79ba02daa5
commit
24be631f86
1 changed files with 3 additions and 1 deletions
|
@ -1261,7 +1261,9 @@ impl ToTokens for Deprecation {
|
|||
}
|
||||
|
||||
fn assert_attr_kind(attr: &ClapAttr, possible_kind: &[AttrKind]) {
|
||||
if !possible_kind.contains(attr.kind.get()) {
|
||||
if *attr.kind.get() == AttrKind::Clap || *attr.kind.get() == AttrKind::StructOpt {
|
||||
// deprecated
|
||||
} else if !possible_kind.contains(attr.kind.get()) {
|
||||
let options = possible_kind
|
||||
.iter()
|
||||
.map(|k| format!("`#[{}({})]`", k.as_str(), attr.name))
|
||||
|
|
Loading…
Reference in a new issue