Skip to content

Commit e00976f

Browse files
committed
make clippy happy
1 parent bfae5c2 commit e00976f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_utils/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,8 +2003,6 @@ pub fn is_expr_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool
20032003
/// * `|(x, y)| (x, y)`
20042004
/// * `|(x, y)| { return (x, y); }`
20052005
fn is_body_identity_function(cx: &LateContext<'_>, func: &Body<'_>) -> bool {
2006-
let [param] = func.params else { return false; };
2007-
20082006
fn check_pat(cx: &LateContext<'_>, pat: &Pat<'_>, expr: &Expr<'_>) -> bool {
20092007
let is_path_to_local =
20102008
|expr, id| path_to_local_id(expr, id) && cx.typeck_results().expr_adjustments(expr).is_empty();
@@ -2020,6 +2018,8 @@ pub fn is_expr_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool
20202018
}
20212019
}
20222020

2021+
let [param] = func.params else { return false; };
2022+
20232023
let mut expr = func.value;
20242024
loop {
20252025
match expr.kind {

0 commit comments

Comments
 (0)