@@ -938,28 +938,8 @@ impl<'a> fmt::Show for Item<'a> {
938
938
None => { }
939
939
}
940
940
941
- if self . cx . include_sources {
942
- let mut path = Vec :: new ( ) ;
943
- clean_srcpath ( self . item . source . filename . as_bytes ( ) , |component| {
944
- path. push ( component. to_owned ( ) ) ;
945
- } ) ;
946
- let href = if self . item . source . loline == self . item . source . hiline {
947
- format ! ( "{}" , self . item. source. loline)
948
- } else {
949
- format ! ( "{}-{}" , self . item. source. loline, self . item. source. hiline)
950
- } ;
951
- try!( write ! ( fmt. buf,
952
- "<a class='source'
953
- href='{root}src/{krate}/{path}.html\\ #{href}'>\
954
- [src]</a>",
955
- root = self . cx. root_path,
956
- krate = self . cx. layout. krate,
957
- path = path. connect( "/" ) ,
958
- href = href) ) ;
959
- }
960
-
961
941
// Write the breadcrumb trail header for the top
962
- try!( write ! ( fmt. buf, "<h1 class='fqn'>" ) ) ;
942
+ try!( write ! ( fmt. buf, "\n <h1 class='fqn'>" ) ) ;
963
943
match self . item . inner {
964
944
clean:: ModuleItem ( ref m) => if m. is_crate {
965
945
try!( write ! ( fmt. buf, "Crate " ) ) ;
@@ -982,9 +962,30 @@ impl<'a> fmt::Show for Item<'a> {
982
962
try!( write ! ( fmt. buf, "<a href='{}index.html'>{}</a>::" ,
983
963
trail, component. as_slice( ) ) ) ;
984
964
}
985
- try!( write ! ( fmt. buf, "<a class='{}' href=''>{}</a></h1> " ,
965
+ try!( write ! ( fmt. buf, "<a class='{}' href=''>{}</a>" ,
986
966
shortty( self . item) , self . item. name. get_ref( ) . as_slice( ) ) ) ;
987
967
968
+ if self . cx . include_sources {
969
+ let mut path = Vec :: new ( ) ;
970
+ clean_srcpath ( self . item . source . filename . as_bytes ( ) , |component| {
971
+ path. push ( component. to_owned ( ) ) ;
972
+ } ) ;
973
+ let href = if self . item . source . loline == self . item . source . hiline {
974
+ format ! ( "{}" , self . item. source. loline)
975
+ } else {
976
+ format ! ( "{}-{}" , self . item. source. loline, self . item. source. hiline)
977
+ } ;
978
+ try!( write ! ( fmt. buf,
979
+ "<a class='source'\
980
+ href='{root}src/{krate}/{path}.html\\ #{href}'>\
981
+ [src]</a>",
982
+ root = self . cx. root_path,
983
+ krate = self . cx. layout. krate,
984
+ path = path. connect( "/" ) ,
985
+ href = href) ) ;
986
+ }
987
+ try!( write ! ( fmt. buf, "</h1>\n " ) ) ;
988
+
988
989
match self . item . inner {
989
990
clean:: ModuleItem ( ref m) => {
990
991
item_module ( fmt. buf , self . cx , self . item , m. items . as_slice ( ) )
0 commit comments