]>
Commit | Line | Data |
---|---|---|
f20569fa | 1 | error: passing a unit value to a function |
04454e1e | 2 | --> $DIR/unit_arg.rs:57:5 |
f20569fa XL |
3 | | |
4 | LL | / foo({ | |
5 | LL | | 1; | |
6 | LL | | }); | |
7 | | |______^ | |
8 | | | |
9 | = note: `-D clippy::unit-arg` implied by `-D warnings` | |
10 | help: remove the semicolon from the last statement in the block | |
11 | | | |
12 | LL | 1 | |
13 | | | |
14 | help: or move the expression in front of the call and replace it with the unit literal `()` | |
15 | | | |
94222f64 XL |
16 | LL ~ { |
17 | LL + 1; | |
18 | LL + }; | |
19 | LL ~ foo(()); | |
f20569fa XL |
20 | | |
21 | ||
22 | error: passing a unit value to a function | |
04454e1e | 23 | --> $DIR/unit_arg.rs:60:5 |
f20569fa XL |
24 | | |
25 | LL | foo(foo(1)); | |
26 | | ^^^^^^^^^^^ | |
27 | | | |
28 | help: move the expression in front of the call and replace it with the unit literal `()` | |
29 | | | |
94222f64 XL |
30 | LL ~ foo(1); |
31 | LL ~ foo(()); | |
f20569fa XL |
32 | | |
33 | ||
34 | error: passing a unit value to a function | |
04454e1e | 35 | --> $DIR/unit_arg.rs:61:5 |
f20569fa XL |
36 | | |
37 | LL | / foo({ | |
38 | LL | | foo(1); | |
39 | LL | | foo(2); | |
40 | LL | | }); | |
41 | | |______^ | |
42 | | | |
43 | help: remove the semicolon from the last statement in the block | |
44 | | | |
45 | LL | foo(2) | |
46 | | | |
47 | help: or move the expression in front of the call and replace it with the unit literal `()` | |
48 | | | |
94222f64 XL |
49 | LL ~ { |
50 | LL + foo(1); | |
51 | LL + foo(2); | |
52 | LL + }; | |
53 | LL ~ foo(()); | |
f20569fa XL |
54 | | |
55 | ||
56 | error: passing a unit value to a function | |
04454e1e | 57 | --> $DIR/unit_arg.rs:66:5 |
f20569fa XL |
58 | | |
59 | LL | / b.bar({ | |
60 | LL | | 1; | |
61 | LL | | }); | |
62 | | |______^ | |
63 | | | |
64 | help: remove the semicolon from the last statement in the block | |
65 | | | |
66 | LL | 1 | |
67 | | | |
68 | help: or move the expression in front of the call and replace it with the unit literal `()` | |
69 | | | |
94222f64 XL |
70 | LL ~ { |
71 | LL + 1; | |
72 | LL + }; | |
73 | LL ~ b.bar(()); | |
f20569fa XL |
74 | | |
75 | ||
76 | error: passing unit values to a function | |
04454e1e | 77 | --> $DIR/unit_arg.rs:69:5 |
f20569fa XL |
78 | | |
79 | LL | taking_multiple_units(foo(0), foo(1)); | |
80 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
81 | | | |
82 | help: move the expressions in front of the call and replace them with the unit literal `()` | |
83 | | | |
94222f64 XL |
84 | LL ~ foo(0); |
85 | LL + foo(1); | |
86 | LL ~ taking_multiple_units((), ()); | |
f20569fa XL |
87 | | |
88 | ||
89 | error: passing unit values to a function | |
04454e1e | 90 | --> $DIR/unit_arg.rs:70:5 |
f20569fa XL |
91 | | |
92 | LL | / taking_multiple_units(foo(0), { | |
93 | LL | | foo(1); | |
94 | LL | | foo(2); | |
95 | LL | | }); | |
96 | | |______^ | |
97 | | | |
98 | help: remove the semicolon from the last statement in the block | |
99 | | | |
100 | LL | foo(2) | |
101 | | | |
102 | help: or move the expressions in front of the call and replace them with the unit literal `()` | |
103 | | | |
94222f64 XL |
104 | LL ~ foo(0); |
105 | LL + { | |
106 | LL + foo(1); | |
107 | LL + foo(2); | |
108 | LL + }; | |
109 | LL ~ taking_multiple_units((), ()); | |
f20569fa XL |
110 | | |
111 | ||
112 | error: passing unit values to a function | |
04454e1e | 113 | --> $DIR/unit_arg.rs:74:5 |
f20569fa XL |
114 | | |
115 | LL | / taking_multiple_units( | |
116 | LL | | { | |
117 | LL | | foo(0); | |
118 | LL | | foo(1); | |
119 | ... | | |
120 | LL | | }, | |
121 | LL | | ); | |
122 | | |_____^ | |
123 | | | |
124 | help: remove the semicolon from the last statement in the block | |
125 | | | |
126 | LL | foo(1) | |
127 | | | |
128 | help: remove the semicolon from the last statement in the block | |
129 | | | |
130 | LL | foo(3) | |
131 | | | |
132 | help: or move the expressions in front of the call and replace them with the unit literal `()` | |
133 | | | |
94222f64 XL |
134 | LL ~ { |
135 | LL + foo(0); | |
136 | LL + foo(1); | |
137 | LL + }; | |
138 | LL + { | |
139 | LL + foo(2); | |
f20569fa XL |
140 | ... |
141 | ||
142 | error: passing a unit value to a function | |
04454e1e | 143 | --> $DIR/unit_arg.rs:85:13 |
f20569fa XL |
144 | | |
145 | LL | None.or(Some(foo(2))); | |
146 | | ^^^^^^^^^^^^ | |
147 | | | |
148 | help: move the expression in front of the call and replace it with the unit literal `()` | |
149 | | | |
94222f64 XL |
150 | LL ~ None.or({ |
151 | LL + foo(2); | |
152 | LL + Some(()) | |
153 | LL ~ }); | |
f20569fa XL |
154 | | |
155 | ||
156 | error: passing a unit value to a function | |
04454e1e | 157 | --> $DIR/unit_arg.rs:88:5 |
f20569fa XL |
158 | | |
159 | LL | foo(foo(())); | |
160 | | ^^^^^^^^^^^^ | |
161 | | | |
162 | help: move the expression in front of the call and replace it with the unit literal `()` | |
163 | | | |
94222f64 XL |
164 | LL ~ foo(()); |
165 | LL ~ foo(()); | |
f20569fa XL |
166 | | |
167 | ||
168 | error: passing a unit value to a function | |
04454e1e | 169 | --> $DIR/unit_arg.rs:125:5 |
f20569fa XL |
170 | | |
171 | LL | Some(foo(1)) | |
172 | | ^^^^^^^^^^^^ | |
173 | | | |
174 | help: move the expression in front of the call and replace it with the unit literal `()` | |
175 | | | |
94222f64 XL |
176 | LL ~ foo(1); |
177 | LL + Some(()) | |
f20569fa XL |
178 | | |
179 | ||
180 | error: aborting due to 10 previous errors | |
181 |