1 #![warn(clippy::unit_arg)]
7 clippy::unnecessary_wraps,
9 clippy::needless_question_mark
14 fn foo<T: Debug>(t: T) {
18 fn foo3<T1: Debug, T2: Debug, T3: Debug>(t1: T1, t2: T2, t3: T3) {
19 println!("{:?}, {:?}, {:?}", t1, t2, t3);
25 fn bar<T: Debug>(&self, t: T) {
30 fn baz<T: Debug>(t: T) {
36 fn do_it(args: Self::Args);
42 fn do_it(_: Self::Args) {}
47 type Args = <A as Tr>::Args;
49 fn do_it(args: Self::Args) {
67 taking_multiple_units(foo(0), foo(1));
68 taking_multiple_units(foo(0), {
72 taking_multiple_units(
82 // here Some(foo(2)) isn't the top level statement expression, wrap the suggestion in a block
83 None.or(Some(foo(2)));
84 // in this case, the suggestion can be inlined, no need for a surrounding block
85 // foo(()); foo(()) instead of { foo(()); foo(()) }
93 foo3("a", 3, vec![3]);
98 let named_unit_arg = ();
104 fn question_mark() -> Result<(), ()> {
112 fn unit_fn() -> Result<(), i32> {
116 fn fallible() -> Result<(), i32> {
122 fn returning_expr() -> Option<()> {
126 fn taking_multiple_units(a: (), b: ()) {}