fix(derive): Remove structopt attribute support

This commit is contained in:
Ed Page 2022-08-26 16:06:10 -05:00
parent ba5eec31f5
commit 521a012c28
3 changed files with 3 additions and 2 deletions

View file

@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- *(derive)* Changed the default for arguments from `parse` to `value_parser`., removing `parse` support
- *(derive)* `subcommand_required(true).arg_required_else_help(true)` is set instead of `SubcommandRequiredElseHelp` (#3280)
- *(derive)* Remove `arg_enum` attribute in favor of `value_enum`
- *(derive)* Remove `structopt()` attributes in favor of `clap()`
### Compatibility

View file

@ -42,7 +42,7 @@ pub fn value_enum(input: TokenStream) -> TokenStream {
/// receiving an instance of `clap::ArgMatches` from conducting parsing, and then
/// implementing a conversion code to instantiate an instance of the user
/// context struct.
#[proc_macro_derive(Parser, attributes(clap, structopt))]
#[proc_macro_derive(Parser, attributes(clap))]
#[proc_macro_error]
pub fn parser(input: TokenStream) -> TokenStream {
let input: DeriveInput = parse_macro_input!(input);

View file

@ -23,7 +23,7 @@ impl ClapAttr {
pub fn parse_all(all_attrs: &[Attribute]) -> Vec<Self> {
all_attrs
.iter()
.filter(|attr| attr.path.is_ident("clap") || attr.path.is_ident("structopt"))
.filter(|attr| attr.path.is_ident("clap"))
.flat_map(|attr| {
attr.parse_args_with(Punctuated::<ClapAttr, Token![,]>::parse_terminated)
.unwrap_or_abort()