Skip to content

Commit d547843

Browse files
committed
shrink more lines
1 parent 8aafe8c commit d547843

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clippy_lints/src/question_mark.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,7 @@ fn expr_return_none_or_err(
208208
fn requires_semi(if_then: &Expr<'_>, if_else: Option<&Expr<'_>>) -> bool {
209209
let if_then_kind = &peel_blocks_with_stmt(if_then).kind;
210210
let if_then_is_ret_stmt = matches!(if_then_kind, ExprKind::Ret(..));
211-
212-
if if_else.is_none() {
213-
return if_then_is_ret_stmt;
214-
}
215-
if let ExprKind::Ret(_) = peel_blocks_with_stmt(if_else.unwrap()).kind {
211+
if if_else.is_none() || matches!(peel_blocks_with_stmt(if_else.unwrap()).kind, ExprKind::Ret(_)) {
216212
return if_then_is_ret_stmt;
217213
}
218214
false

0 commit comments

Comments
 (0)