You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running clippy against this code generates following warning
use proptest_derive::Arbitrary;#[derive(Debug,Arbitrary)]structUser{id:i32,}fnmain(){}
$ cargo clippy -- -Wclippy::all Checking proptest-clippy v0.1.0 (/home/shun/Rust/proptest-clippy)warning: passing a unit value to a function --> src/main.rs:5:5 |5 | id: i32, | ^^ | = note: `-W clippy::unit-arg` implied by `-W clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arghelp: move the expression in front of the call and replace it with the unit literal `()` |5 | {6 | Arbitrary;7 | id8 | }: i32, |warning: 1 warning emitted Finished dev [unoptimized + debuginfo] target(s) in 0.04s
This is too noisy. Is there any chance to address this issue in the library side?
Note that adding #[allow(clippy::unit_arg)] to the type doesn't solve this problem because the warning is from the generated code. One (cumbersome) way to silence this warning in user side is wrapping the definition with mod and allow all lints inside the mod:
mod types {#![allow(clippy::all)]usesuper::*;#[derive(Debug,Arbitrary)]pub(super)structUser{pub(super)id:i32,}}
Though the warning can be silenced by the method above, it would be grateful if the derive macro generates that code.
The text was updated successfully, but these errors were encountered:
Running clippy against this code generates following warning
This is too noisy. Is there any chance to address this issue in the library side?
Note that adding
#[allow(clippy::unit_arg)]
to the type doesn't solve this problem because the warning is from the generated code. One (cumbersome) way to silence this warning in user side is wrapping the definition withmod
and allow all lints inside themod
:Though the warning can be silenced by the method above, it would be grateful if the derive macro generates that code.
The text was updated successfully, but these errors were encountered: