@@ -521,14 +521,6 @@ impl Context {
521
521
}
522
522
}
523
523
}
524
- clean:: StructItem ( s) => {
525
- let mut it = s. fields . move_iter ( ) ;
526
- do self. recurse ( name) |this| {
527
- for item in it {
528
- f ( this, item) ;
529
- }
530
- }
531
- }
532
524
_ => { }
533
525
}
534
526
}
@@ -540,21 +532,19 @@ impl Context {
540
532
541
533
fn shortty ( item : & clean:: Item ) -> & ' static str {
542
534
match item. inner {
543
- clean:: ModuleItem ( * ) => "mod" ,
544
- clean:: StructItem ( * ) => "struct" ,
545
- clean:: EnumItem ( * ) => "enum" ,
546
- clean:: FunctionItem ( * ) => "fn" ,
547
- clean:: TypedefItem ( * ) => "typedef" ,
548
- clean:: StaticItem ( * ) => "static" ,
549
- clean:: TraitItem ( * ) => "trait" ,
550
- clean:: ImplItem ( * ) => "impl" ,
551
- clean:: ViewItemItem ( * ) => "viewitem" ,
552
- clean:: TyMethodItem ( * ) => "tymethod" ,
553
- clean:: MethodItem ( * ) => "method" ,
554
- clean:: StructFieldItem ( * ) => "structfield" ,
555
- clean:: VariantItem ( * ) => "variant" ,
556
- clean:: ForeignFunctionItem ( * ) => "ffi" ,
557
- clean:: ForeignStaticItem ( * ) => "ffs" ,
535
+ clean:: ModuleItem ( * ) => "mod" ,
536
+ clean:: StructItem ( * ) => "struct" ,
537
+ clean:: EnumItem ( * ) => "enum" ,
538
+ clean:: FunctionItem ( * ) => "fn" ,
539
+ clean:: TypedefItem ( * ) => "typedef" ,
540
+ clean:: StaticItem ( * ) => "static" ,
541
+ clean:: TraitItem ( * ) => "trait" ,
542
+ clean:: ImplItem ( * ) => "impl" ,
543
+ clean:: ViewItemItem ( * ) => "viewitem" ,
544
+ clean:: TyMethodItem ( * ) => "tymethod" ,
545
+ clean:: MethodItem ( * ) => "method" ,
546
+ clean:: StructFieldItem ( * ) => "structfield" ,
547
+ clean:: VariantItem ( * ) => "variant" ,
558
548
}
559
549
}
560
550
@@ -594,15 +584,12 @@ impl<'self> fmt::Default for Item<'self> {
594
584
match it. item . inner {
595
585
clean:: ModuleItem ( ref m) => item_module ( fmt. buf , it. cx ,
596
586
it. item , m. items ) ,
597
- clean:: FunctionItem ( ref f) | clean:: ForeignFunctionItem ( ref f) =>
598
- item_function ( fmt. buf , it. item , f) ,
587
+ clean:: FunctionItem ( ref f) => item_function ( fmt. buf , it. item , f) ,
599
588
clean:: TraitItem ( ref t) => item_trait ( fmt. buf , it. item , t) ,
600
589
clean:: StructItem ( ref s) => item_struct ( fmt. buf , it. item , s) ,
601
590
clean:: EnumItem ( ref e) => item_enum ( fmt. buf , it. item , e) ,
602
591
clean:: TypedefItem ( ref t) => item_typedef ( fmt. buf , it. item , t) ,
603
592
clean:: VariantItem ( * ) => item_variant ( fmt. buf , it. cx , it. item ) ,
604
- clean:: StructFieldItem ( * ) => item_struct_field ( fmt. buf , it. cx ,
605
- it. item ) ,
606
593
_ => { }
607
594
}
608
595
}
@@ -676,10 +663,6 @@ fn item_module(w: &mut io::Writer, cx: &Context,
676
663
( _, & clean:: EnumItem ( * ) ) => false ,
677
664
( & clean:: StaticItem ( * ) , _) => true ,
678
665
( _, & clean:: StaticItem ( * ) ) => false ,
679
- ( & clean:: ForeignFunctionItem ( * ) , _) => true ,
680
- ( _, & clean:: ForeignFunctionItem ( * ) ) => false ,
681
- ( & clean:: ForeignStaticItem ( * ) , _) => true ,
682
- ( _, & clean:: ForeignStaticItem ( * ) ) => false ,
683
666
( & clean:: TraitItem ( * ) , _) => true ,
684
667
( _, & clean:: TraitItem ( * ) ) => false ,
685
668
( & clean:: FunctionItem ( * ) , _) => true ,
@@ -707,31 +690,27 @@ fn item_module(w: &mut io::Writer, cx: &Context,
707
690
}
708
691
curty = myty;
709
692
write ! ( w, "<h2>{}</h2>\n <table>" , match myitem. inner {
710
- clean:: ModuleItem ( * ) => "Modules" ,
711
- clean:: StructItem ( * ) => "Structs" ,
712
- clean:: EnumItem ( * ) => "Enums" ,
713
- clean:: FunctionItem ( * ) => "Functions" ,
714
- clean:: TypedefItem ( * ) => "Type Definitions" ,
715
- clean:: StaticItem ( * ) => "Statics" ,
716
- clean:: TraitItem ( * ) => "Traits" ,
717
- clean:: ImplItem ( * ) => "Implementations" ,
718
- clean:: ViewItemItem ( * ) => "Reexports" ,
719
- clean:: TyMethodItem ( * ) => "Type Methods" ,
720
- clean:: MethodItem ( * ) => "Methods" ,
721
- clean:: StructFieldItem ( * ) => "Struct Fields" ,
722
- clean:: VariantItem ( * ) => "Variants" ,
723
- clean:: ForeignFunctionItem ( * ) => "Foreign Functions" ,
724
- clean:: ForeignStaticItem ( * ) => "Foreign Statics" ,
693
+ clean:: ModuleItem ( * ) => "Modules" ,
694
+ clean:: StructItem ( * ) => "Structs" ,
695
+ clean:: EnumItem ( * ) => "Enums" ,
696
+ clean:: FunctionItem ( * ) => "Functions" ,
697
+ clean:: TypedefItem ( * ) => "Type Definitions" ,
698
+ clean:: StaticItem ( * ) => "Statics" ,
699
+ clean:: TraitItem ( * ) => "Traits" ,
700
+ clean:: ImplItem ( * ) => "Implementations" ,
701
+ clean:: ViewItemItem ( * ) => "Reexports" ,
702
+ clean:: TyMethodItem ( * ) => "Type Methods" ,
703
+ clean:: MethodItem ( * ) => "Methods" ,
704
+ clean:: StructFieldItem ( * ) => "Struct Fields" ,
705
+ clean:: VariantItem ( * ) => "Variants" ,
725
706
} ) ;
726
707
}
727
708
728
709
match myitem. inner {
729
- clean:: StaticItem ( ref s) | clean :: ForeignStaticItem ( ref s ) => {
710
+ clean:: StaticItem ( ref s) => {
730
711
struct Initializer < ' self > ( & ' self str ) ;
731
712
impl < ' self > fmt:: Default for Initializer < ' self > {
732
713
fn fmt ( s : & Initializer < ' self > , f : & mut fmt:: Formatter ) {
733
- if s. len ( ) == 0 { return ; }
734
- write ! ( f. buf, "<code> = </code>" ) ;
735
714
let tag = if s. contains ( "\n " ) { "pre" } else { "code" } ;
736
715
write ! ( f. buf, "<{tag}>{}</{tag}>" ,
737
716
s. as_slice( ) , tag=tag) ;
@@ -740,7 +719,7 @@ fn item_module(w: &mut io::Writer, cx: &Context,
740
719
741
720
write ! ( w, "
742
721
<tr>
743
- <td><code>{}static {}: {}</code>{}</td>
722
+ <td><code>{}static {}: {} = </code>{}</td>
744
723
<td class='docblock'>{} </td>
745
724
</tr>
746
725
" ,
@@ -1001,12 +980,11 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
1001
980
for field in fields. iter ( ) {
1002
981
match field. inner {
1003
982
clean:: StructFieldItem ( ref ty) => {
1004
- write ! ( w, " {}<a name='field.{name}'>{name}</a>: \
1005
- {},\n {}",
983
+ write ! ( w, " {}{}: {},\n {}" ,
1006
984
VisSpace ( field. visibility) ,
985
+ field. name. get_ref( ) . as_slice( ) ,
1007
986
ty. type_,
1008
- tab,
1009
- name = field. name. get_ref( ) . as_slice( ) ) ;
987
+ tab) ;
1010
988
}
1011
989
_ => unreachable ! ( )
1012
990
}
@@ -1192,12 +1170,3 @@ fn item_variant(w: &mut io::Writer, cx: &Context, it: &clean::Item) {
1192
1170
* cx. current. last( ) ,
1193
1171
it. name. get_ref( ) . as_slice( ) ) ;
1194
1172
}
1195
-
1196
- fn item_struct_field ( w : & mut io:: Writer , cx : & Context , it : & clean:: Item ) {
1197
- write ! ( w, "<DOCTYPE html><html><head>\
1198
- <meta http-equiv='refresh' content='0; \
1199
- url=../struct.{}.html\\ #field.{}'>\
1200
- </head><body></body></html>",
1201
- * cx. current. last( ) ,
1202
- it. name. get_ref( ) . as_slice( ) ) ;
1203
- }
0 commit comments