Rename variable name in question_mark
This commit is contained in:
@@ -172,8 +172,8 @@ impl QuestionMark {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expression_returns_unmodified_err(cx: &LateContext<'_>, expression: &Expr<'_>, cond_expr: &Expr<'_>) -> bool {
|
fn expression_returns_unmodified_err(cx: &LateContext<'_>, expr: &Expr<'_>, cond_expr: &Expr<'_>) -> bool {
|
||||||
match expression.kind {
|
match expr.kind {
|
||||||
ExprKind::Block(block, _) => {
|
ExprKind::Block(block, _) => {
|
||||||
if let Some(return_expression) = Self::return_expression(block) {
|
if let Some(return_expression) = Self::return_expression(block) {
|
||||||
return Self::expression_returns_unmodified_err(cx, return_expression, cond_expr);
|
return Self::expression_returns_unmodified_err(cx, return_expression, cond_expr);
|
||||||
@@ -181,8 +181,8 @@ impl QuestionMark {
|
|||||||
|
|
||||||
false
|
false
|
||||||
},
|
},
|
||||||
ExprKind::Ret(Some(expr)) => Self::expression_returns_unmodified_err(cx, expr, cond_expr),
|
ExprKind::Ret(Some(ret_expr)) => Self::expression_returns_unmodified_err(cx, ret_expr, cond_expr),
|
||||||
ExprKind::Path(_) => path_to_local(expression) == path_to_local(cond_expr),
|
ExprKind::Path(_) => path_to_local(expr) == path_to_local(cond_expr),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user