mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42: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();
|
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
|
||||||
|
|
||||||
quote! {
|
quote! {
|
||||||
#[allow(dead_code, unreachable_code, unused_variables)]
|
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
|
||||||
#[allow(
|
#[allow(
|
||||||
clippy::style,
|
clippy::style,
|
||||||
clippy::complexity,
|
clippy::complexity,
|
||||||
|
|
|
@ -43,7 +43,7 @@ pub fn gen_for_struct(
|
||||||
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
|
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
|
||||||
|
|
||||||
let tokens = quote! {
|
let tokens = quote! {
|
||||||
#[allow(dead_code, unreachable_code, unused_variables)]
|
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
|
||||||
#[allow(
|
#[allow(
|
||||||
clippy::style,
|
clippy::style,
|
||||||
clippy::complexity,
|
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();
|
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
|
||||||
|
|
||||||
quote! {
|
quote! {
|
||||||
#[allow(dead_code, unreachable_code, unused_variables)]
|
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
|
||||||
#[allow(
|
#[allow(
|
||||||
clippy::style,
|
clippy::style,
|
||||||
clippy::complexity,
|
clippy::complexity,
|
||||||
|
|
|
@ -61,7 +61,7 @@ pub fn gen_for_enum(
|
||||||
quote! {
|
quote! {
|
||||||
#from_arg_matches
|
#from_arg_matches
|
||||||
|
|
||||||
#[allow(dead_code, unreachable_code, unused_variables)]
|
#[allow(dead_code, unreachable_code, unused_variables, unused_braces)]
|
||||||
#[allow(
|
#[allow(
|
||||||
clippy::style,
|
clippy::style,
|
||||||
clippy::complexity,
|
clippy::complexity,
|
||||||
|
|
|
@ -24,7 +24,7 @@ fn try_str(s: &str) -> Result<String, std::convert::Infallible> {
|
||||||
fn warning_never_struct() {
|
fn warning_never_struct() {
|
||||||
#[derive(Parser, Debug, PartialEq)]
|
#[derive(Parser, Debug, PartialEq)]
|
||||||
struct Opt {
|
struct Opt {
|
||||||
#[clap(parse(try_from_str = try_str))]
|
#[clap(parse(try_from_str = try_str), default_value_t)]
|
||||||
s: String,
|
s: String,
|
||||||
}
|
}
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
@ -40,7 +40,7 @@ fn warning_never_enum() {
|
||||||
#[derive(Parser, Debug, PartialEq)]
|
#[derive(Parser, Debug, PartialEq)]
|
||||||
enum Opt {
|
enum Opt {
|
||||||
Foo {
|
Foo {
|
||||||
#[clap(parse(try_from_str = try_str))]
|
#[clap(parse(try_from_str = try_str), default_value_t)]
|
||||||
s: String,
|
s: String,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue