@@ -270,19 +270,16 @@ fn generate_impl(
270
270
make:: path_from_text ( & format ! ( "<{} as {}>" , field_ty, delegate. trait_( ) ?) ) ;
271
271
272
272
let delegate_assoc_items = delegate. get_or_create_assoc_item_list ( ) ;
273
- match bound_def. assoc_item_list ( ) {
274
- Some ( ai) => {
275
- ai. assoc_items ( )
276
- . filter ( |item| matches ! ( item, AssocItem :: MacroCall ( _) ) . not ( ) )
277
- . for_each ( |item| {
278
- let assoc =
279
- process_assoc_item ( item, qualified_path_type. clone ( ) , field_name) ;
280
- if let Some ( assoc) = assoc {
281
- delegate_assoc_items. add_item ( assoc) ;
282
- }
283
- } ) ;
284
- }
285
- None => { }
273
+ if let Some ( ai) = bound_def. assoc_item_list ( ) {
274
+ ai. assoc_items ( )
275
+ . filter ( |item| matches ! ( item, AssocItem :: MacroCall ( _) ) . not ( ) )
276
+ . for_each ( |item| {
277
+ let assoc =
278
+ process_assoc_item ( item, qualified_path_type. clone ( ) , field_name) ;
279
+ if let Some ( assoc) = assoc {
280
+ delegate_assoc_items. add_item ( assoc) ;
281
+ }
282
+ } ) ;
286
283
} ;
287
284
288
285
let target_scope = ctx. sema . scope ( strukt. strukt . syntax ( ) ) ?;
@@ -512,17 +509,14 @@ fn generate_args_for_impl(
512
509
// form the substitution list
513
510
let mut arg_substs = FxHashMap :: default ( ) ;
514
511
515
- match field_ty {
516
- field_ty @ ast:: Type :: PathType ( _) => {
517
- let field_args = field_ty. generic_arg_list ( ) . map ( |gal| gal. generic_args ( ) ) ;
518
- let self_ty_args = self_ty. generic_arg_list ( ) . map ( |gal| gal. generic_args ( ) ) ;
519
- if let ( Some ( field_args) , Some ( self_ty_args) ) = ( field_args, self_ty_args) {
520
- self_ty_args. zip ( field_args) . for_each ( |( self_ty_arg, field_arg) | {
521
- arg_substs. entry ( self_ty_arg. to_string ( ) ) . or_insert ( field_arg) ;
522
- } )
523
- }
512
+ if let field_ty @ ast:: Type :: PathType ( _) = field_ty {
513
+ let field_args = field_ty. generic_arg_list ( ) . map ( |gal| gal. generic_args ( ) ) ;
514
+ let self_ty_args = self_ty. generic_arg_list ( ) . map ( |gal| gal. generic_args ( ) ) ;
515
+ if let ( Some ( field_args) , Some ( self_ty_args) ) = ( field_args, self_ty_args) {
516
+ self_ty_args. zip ( field_args) . for_each ( |( self_ty_arg, field_arg) | {
517
+ arg_substs. entry ( self_ty_arg. to_string ( ) ) . or_insert ( field_arg) ;
518
+ } )
524
519
}
525
- _ => { }
526
520
}
527
521
528
522
let args = old_impl_args
0 commit comments