@@ -80,12 +80,6 @@ impl<T: Clean<U>, U> Clean<U> for Rc<T> {
8080 }
8181}
8282
83- impl < T : Clean < U > , U > Clean < Option < U > > for Option < T > {
84- fn clean ( & self , cx : & mut DocContext < ' _ > ) -> Option < U > {
85- self . as_ref ( ) . map ( |v| v. clean ( cx) )
86- }
87- }
88-
8983impl Clean < Item > for doctree:: Module < ' _ > {
9084 fn clean ( & self , cx : & mut DocContext < ' _ > ) -> Item {
9185 let mut items: Vec < Item > = vec ! [ ] ;
@@ -460,7 +454,7 @@ impl Clean<GenericParamDef> for hir::GenericParam<'_> {
460454 GenericParamDefKind :: Type {
461455 did : cx. tcx . hir ( ) . local_def_id ( self . hir_id ) . to_def_id ( ) ,
462456 bounds : self . bounds . clean ( cx) ,
463- default : default. clean ( cx) . map ( Box :: new) ,
457+ default : default. map ( |t| t . clean ( cx) ) . map ( Box :: new) ,
464458 synthetic,
465459 } ,
466460 ) ,
@@ -935,7 +929,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
935929 TyMethodItem ( t)
936930 }
937931 hir:: TraitItemKind :: Type ( bounds, ref default) => {
938- AssocTypeItem ( bounds. clean ( cx) , default. clean ( cx) )
932+ AssocTypeItem ( bounds. clean ( cx) , default. map ( |t| t . clean ( cx) ) )
939933 }
940934 } ;
941935 let what_rustc_thinks =
@@ -1127,7 +1121,7 @@ impl Clean<Item> for ty::AssocItem {
11271121 None
11281122 } ;
11291123
1130- AssocTypeItem ( bounds, ty. clean ( cx) )
1124+ AssocTypeItem ( bounds, ty. map ( |t| t . clean ( cx) ) )
11311125 } else {
11321126 // FIXME: when could this happen? Associated items in inherent impls?
11331127 let type_ = tcx. type_of ( self . def_id ) . clean ( cx) ;
@@ -1859,7 +1853,7 @@ impl Clean<Item> for hir::Variant<'_> {
18591853fn clean_impl ( impl_ : & hir:: Impl < ' _ > , hir_id : hir:: HirId , cx : & mut DocContext < ' _ > ) -> Vec < Item > {
18601854 let tcx = cx. tcx ;
18611855 let mut ret = Vec :: new ( ) ;
1862- let trait_ = impl_. of_trait . clean ( cx) ;
1856+ let trait_ = impl_. of_trait . as_ref ( ) . map ( |t| t . clean ( cx) ) ;
18631857 let items =
18641858 impl_. items . iter ( ) . map ( |ii| tcx. hir ( ) . impl_item ( ii. id ) . clean ( cx) ) . collect :: < Vec < _ > > ( ) ;
18651859 let def_id = tcx. hir ( ) . local_def_id ( hir_id) ;
0 commit comments