@@ -295,19 +295,22 @@ fn collect_call_arguments(
295
295
continue ;
296
296
} ;
297
297
298
- // Recurse into arguments. They might be a braced list, another call
299
- // that might contain functions, etc.
300
- collect_symbols ( & arg_value, contents, 0 , symbols) ?;
301
-
302
- if arg_value. kind ( ) == "function_definition" {
303
- if let Some ( arg_fun) = arg. child_by_field_name ( "name" ) {
304
- // If this is a named function, collect it as a method
305
- collect_method ( & arg_fun, & arg_value, contents, symbols) ?;
306
- } else {
307
- // Otherwise, just recurse into the function
308
- let body = arg_value. child_by_field_name ( "body" ) . into_result ( ) ?;
309
- collect_symbols ( & body, contents, 0 , symbols) ?;
310
- } ;
298
+ match arg_value. kind ( ) {
299
+ "function_definition" => {
300
+ if let Some ( arg_fun) = arg. child_by_field_name ( "name" ) {
301
+ // If this is a named function, collect it as a method
302
+ collect_method ( & arg_fun, & arg_value, contents, symbols) ?;
303
+ } else {
304
+ // Otherwise, just recurse into the function
305
+ let body = arg_value. child_by_field_name ( "body" ) . into_result ( ) ?;
306
+ collect_symbols ( & body, contents, 0 , symbols) ?;
307
+ } ;
308
+ } ,
309
+ _ => {
310
+ // Recurse into arguments. They might be a braced list, another call
311
+ // that might contain functions, etc.
312
+ collect_symbols ( & arg_value, contents, 0 , symbols) ?;
313
+ } ,
311
314
}
312
315
}
313
316
0 commit comments