File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -2110,7 +2110,7 @@ fn choose_rhs<R: Rewrite>(
2110
2110
expr : & R ,
2111
2111
shape : Shape ,
2112
2112
orig_rhs : Option < String > ,
2113
- _rhs_kind : & RhsAssignKind < ' _ > ,
2113
+ rhs_kind : & RhsAssignKind < ' _ > ,
2114
2114
rhs_tactics : RhsTactics ,
2115
2115
has_rhs_comment : bool ,
2116
2116
) -> Option < String > {
@@ -2141,6 +2141,16 @@ fn choose_rhs<R: Rewrite>(
2141
2141
( Some ( ref orig_rhs) , Some ( ref new_rhs) )
2142
2142
if prefer_next_line ( orig_rhs, new_rhs, rhs_tactics) =>
2143
2143
{
2144
+ if let RhsAssignKind :: Bounds = rhs_kind {
2145
+ if new_rhs. contains ( "->" ) {
2146
+ return Some (
2147
+ new_rhs
2148
+ . lines ( )
2149
+ . map ( |l| format ! ( "{new_indent_str}{l}" ) )
2150
+ . join ( "" ) ,
2151
+ ) ;
2152
+ }
2153
+ }
2144
2154
Some ( format ! ( "{new_indent_str}{new_rhs}" ) )
2145
2155
}
2146
2156
( None , Some ( ref new_rhs) ) => Some ( format ! ( "{new_indent_str}{new_rhs}" ) ) ,
Original file line number Diff line number Diff line change
1
+ trait Foo :
2
+ Fn (
3
+ ReallyLongTypeName ,
4
+ ReallyLongTypeName ,
5
+ ReallyLongTypeName ,
6
+ ReallyLongTypeName ,
7
+ ) -> ReallyLongTypeName
8
+ {
9
+ }
Original file line number Diff line number Diff line change
1
+ trait Foo :
2
+ Fn (
3
+ ReallyLongTypeName ,
4
+ ReallyLongTypeName ,
5
+ ReallyLongTypeName ,
6
+ ReallyLongTypeName ,
7
+ ) -> ReallyLongTypeName
8
+ {
9
+ }
You can’t perform that action at this time.
0 commit comments