File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,7 @@ fn rewrite_nested_use_tree(
460460 list_item. item = use_tree. rewrite ( context, nested_shape) ;
461461 list_items. push ( list_item) ;
462462 }
463- let tactic = if use_tree_list. iter ( ) . any ( |use_segment| {
463+ let ( tactic, remaining_width ) = if use_tree_list. iter ( ) . any ( |use_segment| {
464464 use_segment
465465 . path
466466 . last ( )
@@ -469,14 +469,16 @@ fn rewrite_nested_use_tree(
469469 _ => false ,
470470 } )
471471 } ) {
472- DefinitiveListTactic :: Vertical
472+ ( DefinitiveListTactic :: Vertical , 0 )
473473 } else {
474- definitive_tactic (
474+ let remaining_width = shape. width . checked_sub ( 2 ) . unwrap_or ( 0 ) ;
475+ let tactic = definitive_tactic (
475476 & list_items,
476477 context. config . imports_layout ( ) ,
477478 Separator :: Comma ,
478- shape. width . checked_sub ( 2 ) . unwrap_or ( 0 ) ,
479- )
479+ remaining_width,
480+ ) ;
481+ ( tactic, remaining_width)
480482 } ;
481483 let ends_with_newline = context. config . imports_indent ( ) == IndentStyle :: Block
482484 && tactic != DefinitiveListTactic :: Horizontal ;
You can’t perform that action at this time.
0 commit comments