We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constructor
For example when tried to apply #[allow(clippy::too_many_arguments)] it has no effect. But it works for Debug.
#[allow(clippy::too_many_arguments)]
Debug
use derive_more::Constructor; #[allow(clippy::too_many_arguments)] #[derive(Debug, Constructor)] struct Test{ a: u64, b: u64, c: u64, d: u64, e: u64, f: u64, g: u64, h: u64, i: u64 } fn main() { let test = Test::new(1,2,3,4,5,6,7,8,9); println!("{:?}", test); }
cargo expand output:
cargo expand
#![feature(prelude_import)] #[prelude_import] use std::prelude::rust_2021::*; #[macro_use] extern crate std; use derive_more::Constructor; #[allow(clippy::too_many_arguments)] struct Test { a: u64, b: u64, c: u64, d: u64, e: u64, f: u64, g: u64, h: u64, i: u64, } #[automatically_derived] #[allow(clippy::too_many_arguments)] impl ::core::fmt::Debug for Test { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { let names: &'static _ = &["a", "b", "c", "d", "e", "f", "g", "h", "i"]; let values: &[&dyn ::core::fmt::Debug] = &[ &self.a, &self.b, &self.c, &self.d, &self.e, &self.f, &self.g, &self.h, &&self.i, ]; ::core::fmt::Formatter::debug_struct_fields_finish(f, "Test", names, values) } } #[allow(missing_docs)] #[automatically_derived] impl Test { #[inline] pub const fn new( a: u64, b: u64, c: u64, d: u64, e: u64, f: u64, g: u64, h: u64, i: u64, ) -> Test { Test { a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, } } } fn main() { let test = Test::new(1, 2, 3, 4, 5, 6, 7, 8, 9); { ::std::io::_print(format_args!("{0:?}\n", test)); }; }
The text was updated successfully, but these errors were encountered:
Yeah makes sense, I would accept a fix for this issue. I think the easiest is to always add this #[allow] to the constructor field.
#[allow]
Sorry, something went wrong.
No branches or pull requests
For example when tried to apply
#[allow(clippy::too_many_arguments)]
it has no effect.But it works for
Debug
.cargo expand
output:The text was updated successfully, but these errors were encountered: