Skip to content

Commit f4eb6bd

Browse files
committed
fix: documentation of blocks_in_conditions lint
Updated documentation + example of `blocks_in_conditions` lint, which has been updated recently to include `match` statements as well.
1 parent eb300fd commit f4eb6bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clippy_lints/src/blocks_in_conditions.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_span::sym;
1313

1414
declare_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,

0 commit comments

Comments
 (0)