@@ -2121,8 +2121,8 @@ impl Clean<Vec<Item>> for doctree::Impl<'_> {
2121
2121
Some ( DefKind :: TyAlias ) => Some ( cx. tcx . type_of ( did) . clean ( cx) ) ,
2122
2122
_ => None ,
2123
2123
} ) ;
2124
- if let Some ( type_alias ) = type_alias {
2125
- ret . push ( Item {
2124
+ let make_item = | trait_ : Option < Type > , for_ : Type , items : Vec < Item > | {
2125
+ Item {
2126
2126
name : None ,
2127
2127
attrs : self . attrs . clean ( cx) ,
2128
2128
source : self . whence . clean ( cx) ,
@@ -2134,35 +2134,19 @@ impl Clean<Vec<Item>> for doctree::Impl<'_> {
2134
2134
unsafety : self . unsafety ,
2135
2135
generics : self . generics . clean ( cx) ,
2136
2136
provided_trait_methods : provided. clone ( ) ,
2137
- trait_ : trait_ . clone ( ) ,
2138
- for_ : type_alias ,
2139
- items : items . clone ( ) ,
2137
+ trait_,
2138
+ for_,
2139
+ items,
2140
2140
polarity : Some ( cx. tcx . impl_polarity ( def_id) . clean ( cx) ) ,
2141
2141
synthetic : false ,
2142
2142
blanket_impl : None ,
2143
2143
} ) ,
2144
- } ) ;
2144
+ }
2145
+ } ;
2146
+ if let Some ( type_alias) = type_alias {
2147
+ ret. push ( make_item ( trait_. clone ( ) , type_alias, items. clone ( ) ) ) ;
2145
2148
}
2146
- ret. push ( Item {
2147
- name : None ,
2148
- attrs : self . attrs . clean ( cx) ,
2149
- source : self . whence . clean ( cx) ,
2150
- def_id,
2151
- visibility : self . vis . clean ( cx) ,
2152
- stability : cx. stability ( self . id ) . clean ( cx) ,
2153
- deprecation : cx. deprecation ( self . id ) . clean ( cx) ,
2154
- inner : ImplItem ( Impl {
2155
- unsafety : self . unsafety ,
2156
- generics : self . generics . clean ( cx) ,
2157
- provided_trait_methods : provided,
2158
- trait_,
2159
- for_,
2160
- items,
2161
- polarity : Some ( cx. tcx . impl_polarity ( def_id) . clean ( cx) ) ,
2162
- synthetic : false ,
2163
- blanket_impl : None ,
2164
- } ) ,
2165
- } ) ;
2149
+ ret. push ( make_item ( trait_, for_, items) ) ;
2166
2150
ret
2167
2151
}
2168
2152
}
0 commit comments