@@ -169,7 +169,6 @@ fn union_tpl_pattern_match(
169
169
Some ( ( ) )
170
170
}
171
171
172
- #[ allow( unused) ]
173
172
fn func_tpl_pattern_match (
174
173
db : & DbIndex ,
175
174
config : & mut LuaInferConfig ,
@@ -183,11 +182,19 @@ fn func_tpl_pattern_match(
183
182
let params = doc_func. get_params ( ) ;
184
183
let target_params = target_doc_func. get_params ( ) ;
185
184
for ( i, param_tuple) in params. iter ( ) . enumerate ( ) {
186
- let target_param_tuple = target_params. get ( i) ?;
187
- if param_tuple. 1 . is_some ( ) && target_param_tuple. 1 . is_some ( ) {
188
- let param_type = param_tuple. 1 . clone ( ) ?;
189
- let target_param_type = target_param_tuple. 1 . clone ( ) ?;
190
- tpl_pattern_match ( db, config, root, & param_type, & target_param_type, result) ;
185
+ if let Some ( target_param_tuple) = target_params. get ( i) {
186
+ if param_tuple. 1 . is_some ( ) && target_param_tuple. 1 . is_some ( ) {
187
+ let param_type = param_tuple. 1 . clone ( ) ?;
188
+ let target_param_type = target_param_tuple. 1 . clone ( ) ?;
189
+ tpl_pattern_match (
190
+ db,
191
+ config,
192
+ root,
193
+ & param_type,
194
+ & target_param_type,
195
+ result,
196
+ ) ;
197
+ }
191
198
}
192
199
}
193
200
@@ -214,7 +221,14 @@ fn func_tpl_pattern_match(
214
221
let rets = doc_func. get_ret ( ) ;
215
222
for ( i, ret_type) in rets. iter ( ) . enumerate ( ) {
216
223
if let Some ( signature_ret_info) = & signature. return_docs . get ( i) {
217
- tpl_pattern_match ( db, config, root, ret_type, & signature_ret_info. type_ref , result) ;
224
+ tpl_pattern_match (
225
+ db,
226
+ config,
227
+ root,
228
+ ret_type,
229
+ & signature_ret_info. type_ref ,
230
+ result,
231
+ ) ;
218
232
}
219
233
}
220
234
}
0 commit comments