@@ -73,10 +73,10 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
73
73
record_extern_fqn ( cx, did, clean:: TypeTrait ) ;
74
74
clean:: TraitItem ( build_external_trait ( cx, tcx, did) )
75
75
}
76
- def:: DefFn ( did, style , false ) => {
76
+ def:: DefFn ( did, false ) => {
77
77
// If this function is a tuple struct constructor, we just skip it
78
78
record_extern_fqn ( cx, did, clean:: TypeFunction ) ;
79
- clean:: FunctionItem ( build_external_function ( cx, tcx, did, style ) )
79
+ clean:: FunctionItem ( build_external_function ( cx, tcx, did) )
80
80
}
81
81
def:: DefStruct ( did) => {
82
82
record_extern_fqn ( cx, did, clean:: TypeStruct ) ;
@@ -167,15 +167,14 @@ pub fn build_external_trait(cx: &DocContext, tcx: &ty::ctxt,
167
167
}
168
168
}
169
169
170
- fn build_external_function ( cx : & DocContext , tcx : & ty:: ctxt ,
171
- did : ast:: DefId ,
172
- style : ast:: FnStyle ) -> clean:: Function {
170
+ fn build_external_function ( cx : & DocContext , tcx : & ty:: ctxt , did : ast:: DefId ) -> clean:: Function {
173
171
let t = ty:: lookup_item_type ( tcx, did) ;
172
+ let ( decl, style) = match ty:: get ( t. ty ) . sty {
173
+ ty:: ty_bare_fn( ref f) => ( ( did, & f. sig ) . clean ( cx) , f. fn_style ) ,
174
+ _ => panic ! ( "bad function" ) ,
175
+ } ;
174
176
clean:: Function {
175
- decl : match ty:: get ( t. ty ) . sty {
176
- ty:: ty_bare_fn( ref f) => ( did, & f. sig ) . clean ( cx) ,
177
- _ => panic ! ( "bad function" ) ,
178
- } ,
177
+ decl : decl,
179
178
generics : ( & t. generics , subst:: FnSpace ) . clean ( cx) ,
180
179
fn_style : style,
181
180
}
0 commit comments