File tree Expand file tree Collapse file tree
testdata/VariableAssignment Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -846,7 +846,13 @@ impl<'ast> State<'_, 'ast> {
846846 && get_callee_head_size ( lhs) + lhs_size <= space_left
847847 {
848848 // Keep complex exprs (where callee fits) inline, as they will have breaks
849- print_inline ( self ) ;
849+ if matches ! ( lhs. kind, ast:: ExprKind :: Call ( ..) ) {
850+ self . s . ibox ( -self . ind ) ;
851+ print_inline ( self ) ;
852+ self . end ( ) ;
853+ } else {
854+ print_inline ( self ) ;
855+ }
850856 } else {
851857 print_with_break ( self , false ) ;
852858 }
Original file line number Diff line number Diff line change @@ -59,8 +59,14 @@ contract TestContract {
5959 // https://github.com/foundry-rs/foundry/issues/12322
6060 function test_longComplexBinExpr () {
6161 vars.previousTotalDebt = getDescaledAmount (
62- flow.getSnapshotDebtScaled (streamId),
63- flow.getTokenDecimals (streamId)
64- ) + vars.previousOngoingDebtScaled;
62+ flow.getSnapshotDebtScaled (streamId),
63+ flow.getTokenDecimals (streamId)
64+ ) + vars.previousOngoingDebtScaled;
65+
66+ vars.previousTotalDebt = vars.reallyLongVarThatCausesALineBreak
67+ + vars.previousOngoingDebtScaled;
68+
69+ vars.previousTotalDebt = vars.reallyLongVarThatCausesALineBreak ()
70+ .previousOngoingDebtScaled ();
6571 }
6672}
Original file line number Diff line number Diff line change @@ -58,8 +58,14 @@ contract TestContract {
5858 // https://github.com/foundry-rs/foundry/issues/12322
5959 function test_longComplexBinExpr () {
6060 vars.previousTotalDebt = getDescaledAmount (
61- flow.getSnapshotDebtScaled (streamId),
62- flow.getTokenDecimals (streamId)
63- ) + vars.previousOngoingDebtScaled;
61+ flow.getSnapshotDebtScaled (streamId),
62+ flow.getTokenDecimals (streamId)
63+ ) + vars.previousOngoingDebtScaled;
64+
65+ vars.previousTotalDebt = vars.reallyLongVarThatCausesALineBreak
66+ + vars.previousOngoingDebtScaled;
67+
68+ vars.previousTotalDebt = vars.reallyLongVarThatCausesALineBreak ()
69+ .previousOngoingDebtScaled ();
6470 }
6571}
Original file line number Diff line number Diff line change @@ -46,8 +46,10 @@ contract TestContract {
4646
4747 // https://github.com/foundry-rs/foundry/issues/12322
4848 function test_longComplexBinExpr () {
49- vars.previousTotalDebt =
50- getDescaledAmount (flow.getSnapshotDebtScaled (streamId), flow.getTokenDecimals (streamId))
51- + vars.previousOngoingDebtScaled;
49+ vars.previousTotalDebt = getDescaledAmount (flow.getSnapshotDebtScaled (streamId), flow.getTokenDecimals (streamId)) + vars.previousOngoingDebtScaled;
50+
51+ vars.previousTotalDebt = vars.reallyLongVarThatCausesALineBreak + vars.previousOngoingDebtScaled;
52+
53+ vars.previousTotalDebt = vars.reallyLongVarThatCausesALineBreak () .previousOngoingDebtScaled ();
5254 }
5355}
You can’t perform that action at this time.
0 commit comments