File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -2062,16 +2062,23 @@ pub(super) fn item_path(ty: ItemType, name: &str) -> String {
20622062
20632063fn bounds ( t_bounds : & [ clean:: GenericBound ] , trait_alias : bool , cx : & Context < ' _ > ) -> String {
20642064 let mut bounds = String :: new ( ) ;
2065- if !t_bounds. is_empty ( ) {
2066- if !trait_alias {
2065+ if t_bounds. is_empty ( ) {
2066+ return bounds;
2067+ }
2068+ let has_lots_of_bounds = t_bounds. len ( ) > 2 ;
2069+ let inter_str = if has_lots_of_bounds { "\n + " } else { " + " } ;
2070+ if !trait_alias {
2071+ if has_lots_of_bounds {
2072+ bounds. push_str ( ":\n " ) ;
2073+ } else {
20672074 bounds. push_str ( ": " ) ;
20682075 }
2069- for ( i, p) in t_bounds. iter ( ) . enumerate ( ) {
2070- if i > 0 {
2071- bounds. push_str ( " + " ) ;
2072- }
2073- bounds. push_str ( & p. print ( cx) . to_string ( ) ) ;
2076+ }
2077+ for ( i, p) in t_bounds. iter ( ) . enumerate ( ) {
2078+ if i > 0 {
2079+ bounds. push_str ( inter_str) ;
20742080 }
2081+ bounds. push_str ( & p. print ( cx) . to_string ( ) ) ;
20752082 }
20762083 bounds
20772084}
You can’t perform that action at this time.
0 commit comments