@@ -166,14 +166,6 @@ impl<T: CfgFolder> fold::Folder for T {
166
166
} ;
167
167
168
168
let item = match item {
169
- ast:: ItemKind :: Impl ( u, o, a, b, c, items) => {
170
- let items = items. into_iter ( ) . filter_map ( |item| self . configure ( item) ) . collect ( ) ;
171
- ast:: ItemKind :: Impl ( u, o, a, b, c, items)
172
- }
173
- ast:: ItemKind :: Trait ( u, a, b, items) => {
174
- let items = items. into_iter ( ) . filter_map ( |item| self . configure ( item) ) . collect ( ) ;
175
- ast:: ItemKind :: Trait ( u, a, b, items)
176
- }
177
169
ast:: ItemKind :: Struct ( def, generics) => {
178
170
ast:: ItemKind :: Struct ( fold_struct ( self , def) , generics)
179
171
}
@@ -242,7 +234,17 @@ impl<T: CfgFolder> fold::Folder for T {
242
234
}
243
235
244
236
fn fold_item ( & mut self , item : P < ast:: Item > ) -> SmallVector < P < ast:: Item > > {
245
- self . configure ( item) . map ( |item| SmallVector :: one ( item. map ( |i| self . fold_item_simple ( i) ) ) )
237
+ self . configure ( item) . map ( |item| fold:: noop_fold_item ( item, self ) )
238
+ . unwrap_or ( SmallVector :: zero ( ) )
239
+ }
240
+
241
+ fn fold_impl_item ( & mut self , item : ast:: ImplItem ) -> SmallVector < ast:: ImplItem > {
242
+ self . configure ( item) . map ( |item| fold:: noop_fold_impl_item ( item, self ) )
243
+ . unwrap_or ( SmallVector :: zero ( ) )
244
+ }
245
+
246
+ fn fold_trait_item ( & mut self , item : ast:: TraitItem ) -> SmallVector < ast:: TraitItem > {
247
+ self . configure ( item) . map ( |item| fold:: noop_fold_trait_item ( item, self ) )
246
248
. unwrap_or ( SmallVector :: zero ( ) )
247
249
}
248
250
}
0 commit comments