@@ -80,12 +80,6 @@ impl<T: Clean<U>, U> Clean<U> for Rc<T> {
80
80
}
81
81
}
82
82
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
-
89
83
impl Clean < Item > for doctree:: Module < ' _ > {
90
84
fn clean ( & self , cx : & mut DocContext < ' _ > ) -> Item {
91
85
let mut items: Vec < Item > = vec ! [ ] ;
@@ -460,7 +454,7 @@ impl Clean<GenericParamDef> for hir::GenericParam<'_> {
460
454
GenericParamDefKind :: Type {
461
455
did : cx. tcx . hir ( ) . local_def_id ( self . hir_id ) . to_def_id ( ) ,
462
456
bounds : self . bounds . clean ( cx) ,
463
- default : default. clean ( cx) . map ( Box :: new) ,
457
+ default : default. map ( |t| t . clean ( cx) ) . map ( Box :: new) ,
464
458
synthetic,
465
459
} ,
466
460
) ,
@@ -935,7 +929,7 @@ impl Clean<Item> for hir::TraitItem<'_> {
935
929
TyMethodItem ( t)
936
930
}
937
931
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) ) )
939
933
}
940
934
} ;
941
935
let what_rustc_thinks =
@@ -1127,7 +1121,7 @@ impl Clean<Item> for ty::AssocItem {
1127
1121
None
1128
1122
} ;
1129
1123
1130
- AssocTypeItem ( bounds, ty. clean ( cx) )
1124
+ AssocTypeItem ( bounds, ty. map ( |t| t . clean ( cx) ) )
1131
1125
} else {
1132
1126
// FIXME: when could this happen? Associated items in inherent impls?
1133
1127
let type_ = tcx. type_of ( self . def_id ) . clean ( cx) ;
@@ -1859,7 +1853,7 @@ impl Clean<Item> for hir::Variant<'_> {
1859
1853
fn clean_impl ( impl_ : & hir:: Impl < ' _ > , hir_id : hir:: HirId , cx : & mut DocContext < ' _ > ) -> Vec < Item > {
1860
1854
let tcx = cx. tcx ;
1861
1855
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) ) ;
1863
1857
let items =
1864
1858
impl_. items . iter ( ) . map ( |ii| tcx. hir ( ) . impl_item ( ii. id ) . clean ( cx) ) . collect :: < Vec < _ > > ( ) ;
1865
1859
let def_id = tcx. hir ( ) . local_def_id ( hir_id) ;
0 commit comments