Skip to content

Commit 5d73a2b

Browse files
committed
fix internal failing
1 parent 74527c8 commit 5d73a2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/question_mark.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ impl QuestionMark {
127127
if (Self::result_check_and_early_return(cx, let_expr, nested_expr, Some(ident.name)) &&
128128
(is_lang_ctor(cx, path1, ResultOk) || is_lang_ctor(cx, path1, ResultErr))) ||
129129
(Self::option_check_and_early_return(cx, let_expr, nested_expr) &&
130-
is_lang_ctor(cx, path1, OptionSome)) && path_to_local_id(peel_blocks(if_then), bind_id);
131-
let by_ref = matches!(annot, BindingAnnotation::Ref | BindingAnnotation::RefMut);
130+
is_lang_ctor(cx, path1, OptionSome) && path_to_local_id(peel_blocks(if_then), bind_id));
132131
then {
132+
let by_ref = matches!(annot, BindingAnnotation::Ref | BindingAnnotation::RefMut);
133133
let mut applicability = Applicability::MachineApplicable;
134134
let receiver_str = snippet_with_applicability(cx, let_expr.span, "..", &mut applicability);
135135
let append_semi = Self::is_semicolon_needed(if_then, if_else);
@@ -183,7 +183,7 @@ impl QuestionMark {
183183
/// ```
184184
fn is_semicolon_needed(if_then: &Expr<'_>, if_else: Option<&'_ Expr<'_>>) -> bool {
185185
let if_then_kind = &peel_blocks_with_stmt(if_then).kind;
186-
let if_then_is_ret_stmt = matches!(if_then_kind, ExprKind::Ret(_));
186+
let if_then_is_ret_stmt = matches!(if_then_kind, ExprKind::Ret(..));
187187

188188
if if_else.is_none() {
189189
return if_then_is_ret_stmt;

0 commit comments

Comments
 (0)