mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
Merge pull request #3246 from epage/warn
fix(derive): Don't enit warnings
This commit is contained in:
commit
5c829ffa58
4 changed files with 6 additions and 6 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue