mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
Merge pull request #4866 from hds/v3-allow-almost-swapped
fix(derive): Allow `clippy::almost_swapped`
This commit is contained in:
commit
4b7dbfb811
4 changed files with 7 additions and 0 deletions
|
@ -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> {
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue