Skip to content

Commit 7e7591d

Browse files
committed
Fix manual_option_as_slice for ref bindings
1 parent 470c5b2 commit 7e7591d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

clippy_lints/src/manual_option_as_slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ impl LateLintPass<'_> for ManualOptionAsSlice {
6767
},
6868
ExprKind::If(cond, then, Some(other)) => {
6969
if let ExprKind::Let(let_expr) = cond.kind
70+
&& is_empty_slice(cx, other.peel_blocks())
7071
&& let Some(binding) = extract_ident_from_some_pat(cx, let_expr.pat)
7172
&& check_some_body(cx, binding, then)
72-
&& is_empty_slice(cx, other.peel_blocks())
7373
{
7474
check_as_ref(cx, let_expr.init, span, self.msrv);
7575
}

0 commit comments

Comments
 (0)