File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2003,8 +2003,6 @@ pub fn is_expr_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool
2003
2003
/// * `|(x, y)| (x, y)`
2004
2004
/// * `|(x, y)| { return (x, y); }`
2005
2005
fn is_body_identity_function ( cx : & LateContext < ' _ > , func : & Body < ' _ > ) -> bool {
2006
- let [ param] = func. params else { return false ; } ;
2007
-
2008
2006
fn check_pat ( cx : & LateContext < ' _ > , pat : & Pat < ' _ > , expr : & Expr < ' _ > ) -> bool {
2009
2007
let is_path_to_local =
2010
2008
|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
2020
2018
}
2021
2019
}
2022
2020
2021
+ let [ param] = func. params else { return false ; } ;
2022
+
2023
2023
let mut expr = func. value ;
2024
2024
loop {
2025
2025
match expr. kind {
You can’t perform that action at this time.
0 commit comments