1 #![warn(clippy::unit_arg)]
7 clippy::unnecessary_wraps,
9 clippy::needless_question_mark,
10 clippy::self_named_constructor
15 fn foo<T: Debug>(t: T) {
19 fn foo3<T1: Debug, T2: Debug, T3: Debug>(t1: T1, t2: T2, t3: T3) {
20 println!("{:?}, {:?}, {:?}", t1, t2, t3);
26 fn bar<T: Debug>(&self, t: T) {
31 fn baz<T: Debug>(t: T) {
37 fn do_it(args: Self::Args);
43 fn do_it(_: Self::Args) {}
48 type Args = <A as Tr>::Args;
50 fn do_it(args: Self::Args) {
68 taking_multiple_units(foo(0), foo(1));
69 taking_multiple_units(foo(0), {
73 taking_multiple_units(
83 // here Some(foo(2)) isn't the top level statement expression, wrap the suggestion in a block
84 None.or(Some(foo(2)));
85 // in this case, the suggestion can be inlined, no need for a surrounding block
86 // foo(()); foo(()) instead of { foo(()); foo(()) }
94 foo3("a", 3, vec![3]);
99 let named_unit_arg = ();
105 fn question_mark() -> Result<(), ()> {
113 fn unit_fn() -> Result<(), i32> {
117 fn fallible() -> Result<(), i32> {
123 fn returning_expr() -> Option<()> {
127 fn taking_multiple_units(a: (), b: ()) {}