Skip to content

Commit 82c1ce7

Browse files
committed
misc: use let-chains
1 parent 2208884 commit 82c1ce7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_lints/src/needless_bool.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessBool {
166166
applicability,
167167
);
168168
};
169-
if let Some((a, b)) = fetch_bool_block(then).and_then(|a| Some((a, fetch_bool_block(else_expr)?))) {
169+
if let Some(a) = fetch_bool_block(then)
170+
&& let Some(b) = fetch_bool_block(else_expr)
171+
{
170172
match (a, b) {
171173
(RetBool(true), RetBool(true)) | (Bool(true), Bool(true)) => {
172174
span_lint(

0 commit comments

Comments
 (0)