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 {
2062
2062
2063
2063
fn bounds ( t_bounds : & [ clean:: GenericBound ] , trait_alias : bool , cx : & Context < ' _ > ) -> String {
2064
2064
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 {
2067
2074
bounds. push_str ( ": " ) ;
2068
2075
}
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) ;
2074
2080
}
2081
+ bounds. push_str ( & p. print ( cx) . to_string ( ) ) ;
2075
2082
}
2076
2083
bounds
2077
2084
}
You can’t perform that action at this time.
0 commit comments