Merge pull request #4866 from hds/v3-allow-almost-swapped

fix(derive): Allow `clippy::almost_swapped`
This commit is contained in:
Ed Page 2023-04-27 18:33:40 -05:00 committed by GitHub
commit 4b7dbfb811
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View file

@ -84,6 +84,7 @@ pub fn gen_for_struct(
clippy::nursery,
clippy::cargo,
clippy::suspicious_else_formatting,
clippy::almost_swapped,
)]
impl #impl_generics clap::Args for #struct_name #ty_generics #where_clause {
fn augment_args<'b>(#app_var: clap::Command<'b>) -> clap::Command<'b> {
@ -128,6 +129,7 @@ pub fn gen_from_arg_matches_for_struct(
clippy::nursery,
clippy::cargo,
clippy::suspicious_else_formatting,
clippy::almost_swapped,
)]
impl #impl_generics clap::FromArgMatches for #struct_name #ty_generics #where_clause {
fn from_arg_matches(__clap_arg_matches: &clap::ArgMatches) -> ::std::result::Result<Self, clap::Error> {

View file

@ -54,6 +54,7 @@ pub fn gen_for_struct(
clippy::nursery,
clippy::cargo,
clippy::suspicious_else_formatting,
clippy::almost_swapped,
)]
#[allow(deprecated)]
impl #impl_generics clap::CommandFactory for #struct_name #ty_generics #where_clause {
@ -99,6 +100,7 @@ pub fn gen_for_enum(enum_name: &Ident, generics: &Generics, attrs: &[Attribute])
clippy::nursery,
clippy::cargo,
clippy::suspicious_else_formatting,
clippy::almost_swapped,
)]
impl #impl_generics clap::CommandFactory for #enum_name #ty_generics #where_clause {
fn into_app<'b>() -> clap::Command<'b> {

View file

@ -72,6 +72,7 @@ pub fn gen_for_enum(
clippy::nursery,
clippy::cargo,
clippy::suspicious_else_formatting,
clippy::almost_swapped,
)]
impl #impl_generics clap::Subcommand for #enum_name #ty_generics #where_clause {
fn augment_subcommands <'b>(__clap_app: clap::Command<'b>) -> clap::Command<'b> {
@ -118,6 +119,7 @@ fn gen_from_arg_matches_for_enum(
clippy::nursery,
clippy::cargo,
clippy::suspicious_else_formatting,
clippy::almost_swapped,
)]
impl #impl_generics clap::FromArgMatches for #name #ty_generics #where_clause {
fn from_arg_matches(__clap_arg_matches: &clap::ArgMatches) -> ::std::result::Result<Self, clap::Error> {

View file

@ -59,6 +59,7 @@ pub fn gen_for_enum(name: &Ident, attrs: &[Attribute], e: &DataEnum) -> TokenStr
clippy::nursery,
clippy::cargo,
clippy::suspicious_else_formatting,
clippy::almost_swapped,
)]
impl clap::ValueEnum for #name {
#value_variants