Skip to content

Commit

Permalink
Merge pull request #3246 from epage/warn
Browse files Browse the repository at this point in the history
fix(derive): Don't enit warnings
  • Loading branch information
epage authored Jan 3, 2022
2 parents b0cb205 + 6b9ae54 commit 5c829ff
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clap_derive/src/derives/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub fn gen_from_arg_matches_for_struct(
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();

quote! {
#[allow(dead_code, unreachable_code, unused_variables)]
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
#[allow(
clippy::style,
clippy::complexity,
Expand Down
4 changes: 2 additions & 2 deletions clap_derive/src/derives/into_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn gen_for_struct(
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();

let tokens = quote! {
#[allow(dead_code, unreachable_code, unused_variables)]
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
#[allow(
clippy::style,
clippy::complexity,
Expand Down Expand Up @@ -88,7 +88,7 @@ pub fn gen_for_enum(enum_name: &Ident, generics: &Generics, attrs: &[Attribute])
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();

quote! {
#[allow(dead_code, unreachable_code, unused_variables)]
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
#[allow(
clippy::style,
clippy::complexity,
Expand Down
2 changes: 1 addition & 1 deletion clap_derive/src/derives/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn gen_for_enum(
quote! {
#from_arg_matches

#[allow(dead_code, unreachable_code, unused_variables)]
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
#[allow(
clippy::style,
clippy::complexity,
Expand Down
4 changes: 2 additions & 2 deletions tests/derive/deny_warnings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn try_str(s: &str) -> Result<String, std::convert::Infallible> {
fn warning_never_struct() {
#[derive(Parser, Debug, PartialEq)]
struct Opt {
#[clap(parse(try_from_str = try_str))]
#[clap(parse(try_from_str = try_str), default_value_t)]
s: String,
}
assert_eq!(
Expand All @@ -40,7 +40,7 @@ fn warning_never_enum() {
#[derive(Parser, Debug, PartialEq)]
enum Opt {
Foo {
#[clap(parse(try_from_str = try_str))]
#[clap(parse(try_from_str = try_str), default_value_t)]
s: String,
},
}
Expand Down

0 comments on commit 5c829ff

Please sign in to comment.