Open Arnavion opened 7 years ago
I don't agree with this. A function can have too many arguments whether it is handwritten or generated code. (Of course if it is only called from generated code, that is a different story.)
The lint is saying maybe you shouldn't put #[derive(new)]
on a struct with that many members. If the user wants to ignore that lint, the allow(too_many_arguments)
should go in their code not in derive-new.
That's fine, then the codegen will need to inherit the #[allow]
from the original struct (which core Rust attributes do as well).
If a struct has too many members,
cargo clippy
will complain that the ctor has too many parameters:Emitting a
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
on the ctor should do it, I think.