@@ -589,6 +589,7 @@ impl<'self> fmt::Default for Item<'self> {
589
589
clean:: StructItem ( ref s) => item_struct ( fmt. buf , it. item , s) ,
590
590
clean:: EnumItem ( ref e) => item_enum ( fmt. buf , it. item , e) ,
591
591
clean:: TypedefItem ( ref t) => item_typedef ( fmt. buf , it. item , t) ,
592
+ clean:: VariantItem ( * ) => item_variant ( fmt. buf , it. cx , it. item ) ,
592
593
_ => { }
593
594
}
594
595
}
@@ -930,7 +931,8 @@ fn item_enum(w: &mut io::Writer, it: &clean::Item, e: &clean::Enum) {
930
931
} else {
931
932
write ! ( w, " \\ {\n " ) ;
932
933
for v in e. variants . iter ( ) {
933
- let name = v. name . get_ref ( ) . as_slice ( ) ;
934
+ let name = format ! ( "<a name='variant.{0}'>{0}</a>" ,
935
+ v. name. get_ref( ) . as_slice( ) ) ;
934
936
match v. inner {
935
937
clean:: VariantItem ( ref var) => {
936
938
match var. kind {
@@ -1159,3 +1161,12 @@ fn build_sidebar(m: &clean::Module) -> HashMap<~str, ~[~str]> {
1159
1161
}
1160
1162
return map;
1161
1163
}
1164
+
1165
+ fn item_variant ( w : & mut io:: Writer , cx : & Context , it : & clean:: Item ) {
1166
+ write ! ( w, "<DOCTYPE html><html><head>\
1167
+ <meta http-equiv='refresh' content='0; \
1168
+ url=../enum.{}.html\\ #variant.{}'>\
1169
+ </head><body></body></html>",
1170
+ * cx. current. last( ) ,
1171
+ it. name. get_ref( ) . as_slice( ) ) ;
1172
+ }
0 commit comments