@@ -96,8 +96,9 @@ pub(crate) fn body_has_promise_await<T>(expr: &Expr<T>) -> bool {
9696 Arg :: Positional ( e) | Arg :: Named { value : e, .. } => walk ( e) ,
9797 } )
9898 }
99- ExprKind :: Pipe { left, right } => walk ( left) || walk ( right) ,
100- ExprKind :: Binary { left, right, .. } => walk ( left) || walk ( right) ,
99+ ExprKind :: Pipe { left, right } | ExprKind :: Binary { left, right, .. } => {
100+ walk ( left) || walk ( right)
101+ }
101102 ExprKind :: Member { object, .. } => walk ( object) ,
102103 ExprKind :: Unary { operand, .. }
103104 | ExprKind :: Grouped ( operand)
@@ -108,7 +109,7 @@ pub(crate) fn body_has_promise_await<T>(expr: &Expr<T>) -> bool {
108109 match & item. kind {
109110 ItemKind :: Expr ( e) => walk ( e) ,
110111 ItemKind :: Const ( c) => walk ( & c. value ) ,
111- ItemKind :: Function ( _ ) => false , // don't descend into nested functions
112+ // don't descend into nested functions
112113 _ => false ,
113114 }
114115 } ) ,
@@ -117,7 +118,6 @@ pub(crate) fn body_has_promise_await<T>(expr: &Expr<T>) -> bool {
117118 }
118119 ExprKind :: Array ( items) | ExprKind :: Tuple ( items) => items. iter ( ) . any ( walk) ,
119120 // Don't recurse into nested arrows — they're separate async contexts
120- ExprKind :: Arrow { .. } => false ,
121121 _ => false ,
122122 }
123123 }
@@ -127,7 +127,14 @@ pub(crate) fn body_has_promise_await<T>(expr: &Expr<T>) -> bool {
127127use crate :: diagnostic:: Diagnostic ;
128128use crate :: interop:: { self , DtsExport } ;
129129use crate :: lexer:: span:: Span ;
130- use crate :: parser:: ast:: * ;
130+ use crate :: parser:: ast:: {
131+ Arg , BinOp , ConstBinding , ConstDecl , DefaultExportDecl , Expr , ExprKind , ForBlock , FunctionDecl ,
132+ ImportDecl , Item , ItemKind , JsxChild , JsxElement , JsxElementKind , JsxProp , LiteralPattern ,
133+ MatchArm , ObjectDestructureField , Param , ParamDestructure , Pattern , PatternKind , Program ,
134+ RecordEntry , RecordField , StringPatternSegment , TemplatePart , TestBlock , TestStatement ,
135+ TraitDecl , TypeDecl , TypeDef , TypeExpr , TypeExprKind , UnaryOp , VariantPatternFields ,
136+ params_have_self,
137+ } ;
131138use crate :: resolve:: ResolvedImports ;
132139use crate :: stdlib:: StdlibRegistry ;
133140use crate :: type_layout;
@@ -309,6 +316,7 @@ impl Default for Checker {
309316}
310317
311318impl Checker {
319+ #[ allow( clippy:: too_many_lines) ]
312320 pub fn new ( ) -> Self {
313321 let mut env = TypeEnv :: new ( ) ;
314322
@@ -685,6 +693,8 @@ impl Checker {
685693 /// that need additional state off the checker (references, traits,
686694 /// etc.) can read it afterward.
687695 #[ allow( clippy:: type_complexity) ]
696+ #[ allow( clippy:: too_many_lines) ]
697+ #[ allow( clippy:: cognitive_complexity) ]
688698 pub ( crate ) fn check_all (
689699 & mut self ,
690700 program : & Program ,
@@ -762,7 +772,7 @@ impl Checker {
762772 self . env . define ( & func. name , fn_type) ;
763773 self . unused
764774 . defined_sources
765- . insert ( func. name . clone ( ) , format ! ( "function from \" {}\" " , source ) ) ;
775+ . insert ( func. name . clone ( ) , format ! ( "function from \" {source }\" " ) ) ;
766776 if required_params < func. params . len ( ) {
767777 self . fn_required_params
768778 . insert ( func. name . clone ( ) , required_params) ;
0 commit comments