@@ -144,7 +144,7 @@ pub fn ident_to_param_def(
144144 _parsed_source : Option < & ParsedSource > ,
145145 ident : & deno_ast:: swc:: ast:: BindingIdent ,
146146) -> ParamDef {
147- let ts_type = ident. type_ann . as_ref ( ) . map ( |rt| ts_type_ann_to_def ( rt ) ) ;
147+ let ts_type = ident. type_ann . as_ref ( ) . map ( ts_type_ann_to_def) ;
148148
149149 ParamDef :: Identifier {
150150 name : ident. id . sym . to_string ( ) ,
@@ -157,7 +157,7 @@ fn rest_pat_to_param_def(
157157 parsed_source : Option < & ParsedSource > ,
158158 rest_pat : & deno_ast:: swc:: ast:: RestPat ,
159159) -> ParamDef {
160- let ts_type = rest_pat. type_ann . as_ref ( ) . map ( |rt| ts_type_ann_to_def ( rt ) ) ;
160+ let ts_type = rest_pat. type_ann . as_ref ( ) . map ( ts_type_ann_to_def) ;
161161
162162 ParamDef :: Rest {
163163 arg : Box :: new ( pat_to_param_def ( parsed_source, & * rest_pat. arg ) ) ,
@@ -193,10 +193,7 @@ fn object_pat_to_param_def(
193193 . iter ( )
194194 . map ( |prop| object_pat_prop_to_def ( parsed_source, prop) )
195195 . collect :: < Vec < _ > > ( ) ;
196- let ts_type = object_pat
197- . type_ann
198- . as_ref ( )
199- . map ( |rt| ts_type_ann_to_def ( rt) ) ;
196+ let ts_type = object_pat. type_ann . as_ref ( ) . map ( ts_type_ann_to_def) ;
200197
201198 ParamDef :: Object {
202199 props,
@@ -214,7 +211,7 @@ fn array_pat_to_param_def(
214211 . iter ( )
215212 . map ( |elem| elem. as_ref ( ) . map ( |e| pat_to_param_def ( parsed_source, e) ) )
216213 . collect :: < Vec < Option < _ > > > ( ) ;
217- let ts_type = array_pat. type_ann . as_ref ( ) . map ( |rt| ts_type_ann_to_def ( rt ) ) ;
214+ let ts_type = array_pat. type_ann . as_ref ( ) . map ( ts_type_ann_to_def) ;
218215
219216 ParamDef :: Array {
220217 elements,
@@ -227,10 +224,7 @@ pub fn assign_pat_to_param_def(
227224 parsed_source : Option < & ParsedSource > ,
228225 assign_pat : & deno_ast:: swc:: ast:: AssignPat ,
229226) -> ParamDef {
230- let ts_type = assign_pat
231- . type_ann
232- . as_ref ( )
233- . map ( |rt| ts_type_ann_to_def ( rt) ) ;
227+ let ts_type = assign_pat. type_ann . as_ref ( ) . map ( ts_type_ann_to_def) ;
234228
235229 ParamDef :: Assign {
236230 left : Box :: new ( pat_to_param_def ( parsed_source, & * assign_pat. left ) ) ,
0 commit comments