From fa76f6f78d58b4222372bc2ded2a424d38dd4ae7 Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Mon, 27 Feb 2023 21:24:37 -0800 Subject: [PATCH] fix: Remove strict linting from generated code fix https://github.com/clap-rs/clap/issues/4733 --- clap_derive/src/derives/args.rs | 2 -- clap_derive/src/derives/into_app.rs | 2 -- clap_derive/src/derives/subcommand.rs | 2 -- clap_derive/src/derives/value_enum.rs | 1 - 4 files changed, 7 deletions(-) diff --git a/clap_derive/src/derives/args.rs b/clap_derive/src/derives/args.rs index d019cd7a578..d3b36926b2a 100644 --- a/clap_derive/src/derives/args.rs +++ b/clap_derive/src/derives/args.rs @@ -111,7 +111,6 @@ pub fn gen_for_struct( clippy::suspicious_else_formatting, clippy::almost_swapped, )] - #[deny(clippy::correctness)] impl #impl_generics clap::FromArgMatches for #item_name #ty_generics #where_clause { fn from_arg_matches(__clap_arg_matches: &clap::ArgMatches) -> ::std::result::Result { Self::from_arg_matches_mut(&mut __clap_arg_matches.clone()) @@ -147,7 +146,6 @@ pub fn gen_for_struct( clippy::suspicious_else_formatting, clippy::almost_swapped, )] - #[deny(clippy::correctness)] impl #impl_generics clap::Args for #item_name #ty_generics #where_clause { fn group_id() -> Option { #group_id diff --git a/clap_derive/src/derives/into_app.rs b/clap_derive/src/derives/into_app.rs index 4241ac0e7dd..dfb676a3bcb 100644 --- a/clap_derive/src/derives/into_app.rs +++ b/clap_derive/src/derives/into_app.rs @@ -38,7 +38,6 @@ pub fn gen_for_struct(item: &Item, item_name: &Ident, generics: &Generics) -> To clippy::suspicious_else_formatting, clippy::almost_swapped, )] - #[deny(clippy::correctness)] impl #impl_generics clap::CommandFactory for #item_name #ty_generics #where_clause { fn command<'b>() -> clap::Command { let #app_var = clap::Command::new(#name); @@ -75,7 +74,6 @@ pub fn gen_for_enum(item: &Item, item_name: &Ident, generics: &Generics) -> Toke clippy::suspicious_else_formatting, clippy::almost_swapped, )] - #[deny(clippy::correctness)] impl #impl_generics clap::CommandFactory for #item_name #ty_generics #where_clause { fn command<'b>() -> clap::Command { let #app_var = clap::Command::new(#name) diff --git a/clap_derive/src/derives/subcommand.rs b/clap_derive/src/derives/subcommand.rs index e5bf16dec9c..ffe22ec2c17 100644 --- a/clap_derive/src/derives/subcommand.rs +++ b/clap_derive/src/derives/subcommand.rs @@ -82,7 +82,6 @@ pub fn gen_for_enum( clippy::suspicious_else_formatting, clippy::almost_swapped, )] - #[deny(clippy::correctness)] impl #impl_generics clap::FromArgMatches for #item_name #ty_generics #where_clause { fn from_arg_matches(__clap_arg_matches: &clap::ArgMatches) -> ::std::result::Result { Self::from_arg_matches_mut(&mut __clap_arg_matches.clone()) @@ -109,7 +108,6 @@ pub fn gen_for_enum( clippy::suspicious_else_formatting, clippy::almost_swapped, )] - #[deny(clippy::correctness)] impl #impl_generics clap::Subcommand for #item_name #ty_generics #where_clause { fn augment_subcommands <'b>(__clap_app: clap::Command) -> clap::Command { #augmentation diff --git a/clap_derive/src/derives/value_enum.rs b/clap_derive/src/derives/value_enum.rs index 1e2daf3965d..7a9d870ec51 100644 --- a/clap_derive/src/derives/value_enum.rs +++ b/clap_derive/src/derives/value_enum.rs @@ -67,7 +67,6 @@ pub fn gen_for_enum(item: &Item, item_name: &Ident, variants: &[(&Variant, Item) clippy::suspicious_else_formatting, clippy::almost_swapped, )] - #[deny(clippy::correctness)] impl clap::ValueEnum for #item_name { #value_variants #to_possible_value