@@ -76,20 +76,20 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
76
76
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & Expr < ' tcx > ) {
77
77
if let ExprKind :: MethodCall ( _method, receiver, args, _) = expr. kind {
78
78
for arg in args {
79
- check_clousure ( cx, Some ( receiver) , arg) ;
79
+ check_closure ( cx, Some ( receiver) , arg) ;
80
80
}
81
81
}
82
82
if let ExprKind :: Call ( func, args) = expr. kind {
83
- check_clousure ( cx, None , func) ;
83
+ check_closure ( cx, None , func) ;
84
84
for arg in args {
85
- check_clousure ( cx, None , arg) ;
85
+ check_closure ( cx, None , arg) ;
86
86
}
87
87
}
88
88
}
89
89
}
90
90
91
91
#[ allow( clippy:: too_many_lines) ]
92
- fn check_clousure < ' tcx > ( cx : & LateContext < ' tcx > , outer_receiver : Option < & Expr < ' tcx > > , expr : & Expr < ' tcx > ) {
92
+ fn check_closure < ' tcx > ( cx : & LateContext < ' tcx > , outer_receiver : Option < & Expr < ' tcx > > , expr : & Expr < ' tcx > ) {
93
93
let body = if let ExprKind :: Closure ( c) = expr. kind
94
94
&& c. fn_decl . inputs . iter ( ) . all ( |ty| matches ! ( ty. kind, TyKind :: Infer ) )
95
95
&& matches ! ( c. fn_decl. output, FnRetTy :: DefaultReturn ( _) )
0 commit comments