@@ -28,7 +28,6 @@ use extra::json::ToJson;
28
28
use extra:: sort;
29
29
30
30
use syntax:: ast;
31
- use syntax:: attr;
32
31
33
32
use clean;
34
33
use doctree;
@@ -522,14 +521,6 @@ impl Context {
522
521
}
523
522
}
524
523
}
525
- clean:: StructItem ( s) => {
526
- let mut it = s. fields . move_iter ( ) ;
527
- do self. recurse ( name) |this| {
528
- for item in it {
529
- f ( this, item) ;
530
- }
531
- }
532
- }
533
524
_ => { }
534
525
}
535
526
}
@@ -541,21 +532,19 @@ impl Context {
541
532
542
533
fn shortty ( item : & clean:: Item ) -> & ' static str {
543
534
match item. inner {
544
- clean:: ModuleItem ( * ) => "mod" ,
545
- clean:: StructItem ( * ) => "struct" ,
546
- clean:: EnumItem ( * ) => "enum" ,
547
- clean:: FunctionItem ( * ) => "fn" ,
548
- clean:: TypedefItem ( * ) => "typedef" ,
549
- clean:: StaticItem ( * ) => "static" ,
550
- clean:: TraitItem ( * ) => "trait" ,
551
- clean:: ImplItem ( * ) => "impl" ,
552
- clean:: ViewItemItem ( * ) => "viewitem" ,
553
- clean:: TyMethodItem ( * ) => "tymethod" ,
554
- clean:: MethodItem ( * ) => "method" ,
555
- clean:: StructFieldItem ( * ) => "structfield" ,
556
- clean:: VariantItem ( * ) => "variant" ,
557
- clean:: ForeignFunctionItem ( * ) => "ffi" ,
558
- 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" ,
559
548
}
560
549
}
561
550
@@ -569,18 +558,6 @@ impl<'self> Item<'self> {
569
558
570
559
impl < ' self > fmt:: Default for Item < ' self > {
571
560
fn fmt ( it : & Item < ' self > , fmt : & mut fmt:: Formatter ) {
572
- match attr:: find_stability ( it. item . attrs . iter ( ) ) {
573
- Some ( stability) => {
574
- write ! ( fmt. buf,
575
- "<a class='stability {lvl}' title='{reason}'>{lvl}</a>" ,
576
- lvl = stability. level. to_str( ) ,
577
- reason = match stability. text {
578
- Some ( s) => s, None => @"" ,
579
- } ) ;
580
- }
581
- None => { }
582
- }
583
-
584
561
// Write the breadcrumb trail header for the top
585
562
write ! ( fmt. buf, "<h1 class='fqn'>" ) ;
586
563
match it. item . inner {
@@ -607,15 +584,12 @@ impl<'self> fmt::Default for Item<'self> {
607
584
match it. item . inner {
608
585
clean:: ModuleItem ( ref m) => item_module ( fmt. buf , it. cx ,
609
586
it. item , m. items ) ,
610
- clean:: FunctionItem ( ref f) | clean:: ForeignFunctionItem ( ref f) =>
611
- item_function ( fmt. buf , it. item , f) ,
587
+ clean:: FunctionItem ( ref f) => item_function ( fmt. buf , it. item , f) ,
612
588
clean:: TraitItem ( ref t) => item_trait ( fmt. buf , it. item , t) ,
613
589
clean:: StructItem ( ref s) => item_struct ( fmt. buf , it. item , s) ,
614
590
clean:: EnumItem ( ref e) => item_enum ( fmt. buf , it. item , e) ,
615
591
clean:: TypedefItem ( ref t) => item_typedef ( fmt. buf , it. item , t) ,
616
592
clean:: VariantItem ( * ) => item_variant ( fmt. buf , it. cx , it. item ) ,
617
- clean:: StructFieldItem ( * ) => item_struct_field ( fmt. buf , it. cx ,
618
- it. item ) ,
619
593
_ => { }
620
594
}
621
595
}
@@ -689,10 +663,6 @@ fn item_module(w: &mut io::Writer, cx: &Context,
689
663
( _, & clean:: EnumItem ( * ) ) => false ,
690
664
( & clean:: StaticItem ( * ) , _) => true ,
691
665
( _, & clean:: StaticItem ( * ) ) => false ,
692
- ( & clean:: ForeignFunctionItem ( * ) , _) => true ,
693
- ( _, & clean:: ForeignFunctionItem ( * ) ) => false ,
694
- ( & clean:: ForeignStaticItem ( * ) , _) => true ,
695
- ( _, & clean:: ForeignStaticItem ( * ) ) => false ,
696
666
( & clean:: TraitItem ( * ) , _) => true ,
697
667
( _, & clean:: TraitItem ( * ) ) => false ,
698
668
( & clean:: FunctionItem ( * ) , _) => true ,
@@ -720,31 +690,27 @@ fn item_module(w: &mut io::Writer, cx: &Context,
720
690
}
721
691
curty = myty;
722
692
write ! ( w, "<h2>{}</h2>\n <table>" , match myitem. inner {
723
- clean:: ModuleItem ( * ) => "Modules" ,
724
- clean:: StructItem ( * ) => "Structs" ,
725
- clean:: EnumItem ( * ) => "Enums" ,
726
- clean:: FunctionItem ( * ) => "Functions" ,
727
- clean:: TypedefItem ( * ) => "Type Definitions" ,
728
- clean:: StaticItem ( * ) => "Statics" ,
729
- clean:: TraitItem ( * ) => "Traits" ,
730
- clean:: ImplItem ( * ) => "Implementations" ,
731
- clean:: ViewItemItem ( * ) => "Reexports" ,
732
- clean:: TyMethodItem ( * ) => "Type Methods" ,
733
- clean:: MethodItem ( * ) => "Methods" ,
734
- clean:: StructFieldItem ( * ) => "Struct Fields" ,
735
- clean:: VariantItem ( * ) => "Variants" ,
736
- clean:: ForeignFunctionItem ( * ) => "Foreign Functions" ,
737
- 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" ,
738
706
} ) ;
739
707
}
740
708
741
709
match myitem. inner {
742
- clean:: StaticItem ( ref s) | clean :: ForeignStaticItem ( ref s ) => {
710
+ clean:: StaticItem ( ref s) => {
743
711
struct Initializer < ' self > ( & ' self str ) ;
744
712
impl < ' self > fmt:: Default for Initializer < ' self > {
745
713
fn fmt ( s : & Initializer < ' self > , f : & mut fmt:: Formatter ) {
746
- if s. len ( ) == 0 { return ; }
747
- write ! ( f. buf, "<code> = </code>" ) ;
748
714
let tag = if s. contains ( "\n " ) { "pre" } else { "code" } ;
749
715
write ! ( f. buf, "<{tag}>{}</{tag}>" ,
750
716
s. as_slice( ) , tag=tag) ;
@@ -753,7 +719,7 @@ fn item_module(w: &mut io::Writer, cx: &Context,
753
719
754
720
write ! ( w, "
755
721
<tr>
756
- <td><code>{}static {}: {}</code>{}</td>
722
+ <td><code>{}static {}: {} = </code>{}</td>
757
723
<td class='docblock'>{} </td>
758
724
</tr>
759
725
" ,
@@ -1014,12 +980,11 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
1014
980
for field in fields. iter ( ) {
1015
981
match field. inner {
1016
982
clean:: StructFieldItem ( ref ty) => {
1017
- write ! ( w, " {}<a name='field.{name}'>{name}</a>: \
1018
- {},\n {}",
983
+ write ! ( w, " {}{}: {},\n {}" ,
1019
984
VisSpace ( field. visibility) ,
985
+ field. name. get_ref( ) . as_slice( ) ,
1020
986
ty. type_,
1021
- tab,
1022
- name = field. name. get_ref( ) . as_slice( ) ) ;
987
+ tab) ;
1023
988
}
1024
989
_ => unreachable ! ( )
1025
990
}
@@ -1205,12 +1170,3 @@ fn item_variant(w: &mut io::Writer, cx: &Context, it: &clean::Item) {
1205
1170
* cx. current. last( ) ,
1206
1171
it. name. get_ref( ) . as_slice( ) ) ;
1207
1172
}
1208
-
1209
- fn item_struct_field ( w : & mut io:: Writer , cx : & Context , it : & clean:: Item ) {
1210
- write ! ( w, "<DOCTYPE html><html><head>\
1211
- <meta http-equiv='refresh' content='0; \
1212
- url=../struct.{}.html\\ #field.{}'>\
1213
- </head><body></body></html>",
1214
- * cx. current. last( ) ,
1215
- it. name. get_ref( ) . as_slice( ) ) ;
1216
- }
0 commit comments