File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ use rustc_span::sym;
1313
1414declare_clippy_lint ! {
1515 /// ### What it does
16- /// Checks for `if` conditions that use blocks containing an
16+ /// Checks for `if` and `match` conditions that use blocks containing an
1717 /// expression, statements or conditions that use closures with blocks.
1818 ///
1919 /// ### Why is this bad?
@@ -25,6 +25,8 @@ declare_clippy_lint! {
2525 /// if { true } { /* ... */ }
2626 ///
2727 /// if { let x = somefunc(); x } { /* ... */ }
28+ ///
29+ /// match { let e = somefunc(); e } { /* ... */ }
2830 /// ```
2931 ///
3032 /// Use instead:
@@ -34,6 +36,9 @@ declare_clippy_lint! {
3436 ///
3537 /// let res = { let x = somefunc(); x };
3638 /// if res { /* ... */ }
39+ ///
40+ /// let res = { let e = somefunc(); e };
41+ /// match res { /* ... */ }
3742 /// ```
3843 #[ clippy:: version = "1.45.0" ]
3944 pub BLOCKS_IN_CONDITIONS ,
You can’t perform that action at this time.
0 commit comments