3 #![warn(clippy::match_like_matches_macro)]
7 clippy
::equatable_if_let
,
8 clippy
::needless_borrowed_reference
34 Some(r
) if r
== 0 => false,
39 let _zzz
= if let Some(5) = x { true }
else { false }
;
71 // skip rustfmt to prevent removing block for first pattern
110 E
::A(a
) if a
< 10 => false,
111 E
::B(a
) if a
< 10 => false,
119 E
::B(a
) if a
< 10 => false,
141 // should print "z" in suggestion (#6503)
150 // this could also print "z" in suggestion..?
164 fn foo(_x
: AnEnum
) {}
168 // we can't remove the reference here!
180 fn fun(_val
: Option
<S
>) {}
181 let val
= Some(S(42));
182 // we need the reference here because later val is consumed by fun()
183 let _res
= match &val
{
184 &Some(ref _a
) => true,
193 fn fun(_val
: Option
<S
>) {}
194 let val
= Some(S(42));
195 let _res
= match &val
{
196 &Some(ref _a
) => true,
211 #[cfg(feature = "foo")]
218 // ignore if match block contains comment
219 let _line_comments
= match x
{
221 '
1'
| '
2'
| '
3'
=> true,
222 // spaces are very important to be true.
229 let _block_comments
= match x
{
232 '
1'
| '
2'
| '
3'
=> true,
233 /* spaces are very important to be true.
243 #[clippy::msrv = "1.41"]
245 let _y
= match Some(5) {
251 #[clippy::msrv = "1.42"]
253 let _y
= match Some(5) {