Merge pull request #3246 from epage/warn

fix(derive): Don't enit warnings
This commit is contained in:
Ed Page 2022-01-03 11:55:16 -06:00 committed by GitHub
commit 5c829ffa58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -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,

View file

@ -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,
@ -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,

View file

@ -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,

View file

@ -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!(
@ -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,
},
}