@@ -594,28 +594,32 @@ fn do_to_string(
594
594
|> do_to_string ( max_width , indent , rest )
595
595
}
596
596
597
- ForceBreak ( doc ) ->
598
- [ # ( indent , ForceBroken , doc ) , .. rest ]
599
- |> do_to_string ( acc , max_width , current_width , _)
597
+ ForceBreak ( doc ) -> {
598
+ let docs = [ # ( indent , ForceBroken , doc ) , .. rest ]
599
+ do_to_string ( acc , max_width , current_width , docs )
600
+ }
600
601
601
- Concat ( docs ) ->
602
- list . map ( docs , fn ( doc ) { # ( indent , mode , doc ) } )
603
- |> list . append ( rest )
604
- |> do_to_string ( acc , max_width , current_width , _)
602
+ Concat ( docs ) -> {
603
+ let docs =
604
+ list . map ( docs , fn ( doc ) { # ( indent , mode , doc ) } )
605
+ |> list . append ( rest )
606
+ do_to_string ( acc , max_width , current_width , docs )
607
+ }
605
608
606
609
Group ( doc ) -> {
607
610
let fits = fits ( [ # ( indent , Unbroken , doc ) ] , max_width , current_width )
608
611
let new_mode = case fits {
609
612
True -> Unbroken
610
613
False -> Broken
611
614
}
612
- [ # ( indent , new_mode , doc ) , .. rest ]
613
- |> do_to_string ( acc , max_width , current_width , _ )
615
+ let docs = [ # ( indent , new_mode , doc ) , .. rest ]
616
+ do_to_string ( acc , max_width , current_width , docs )
614
617
}
615
618
616
- Nest ( doc , i ) ->
617
- [ # ( indent + i , mode , doc ) , .. rest ]
618
- |> do_to_string ( acc , max_width , current_width , _)
619
+ Nest ( doc , i ) -> {
620
+ let docs = [ # ( indent + i , mode , doc ) , .. rest ]
621
+ do_to_string ( acc , max_width , current_width , docs )
622
+ }
619
623
620
624
Text ( text : text , length : length ) ->
621
625
do_to_string ( acc <> text , max_width , current_width + length , rest )
0 commit comments