From 521a012c281d9086475fe503817f11748ea1d705 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 26 Aug 2022 16:06:10 -0500 Subject: [PATCH] fix(derive): Remove structopt attribute support --- CHANGELOG.md | 1 + clap_derive/src/lib.rs | 2 +- clap_derive/src/parse.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 579d299e..fc6688d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/clap_derive/src/lib.rs b/clap_derive/src/lib.rs index 20464ab4..3d134e98 100644 --- a/clap_derive/src/lib.rs +++ b/clap_derive/src/lib.rs @@ -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); diff --git a/clap_derive/src/parse.rs b/clap_derive/src/parse.rs index 91aed44b..03a6d457 100644 --- a/clap_derive/src/parse.rs +++ b/clap_derive/src/parse.rs @@ -23,7 +23,7 @@ impl ClapAttr { pub fn parse_all(all_attrs: &[Attribute]) -> Vec { 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::::parse_terminated) .unwrap_or_abort()