@@ -941,16 +941,26 @@ fn join_bounds_inner(
941
941
ast:: GenericBound :: Trait ( ..) => last_line_extendable ( s) ,
942
942
} ;
943
943
944
- // Whether a PathSegment segment includes internal array containing more than one item
945
- let is_segment_with_multi_items_array = |seg : & ast:: PathSegment | {
946
- if let Some ( args_in) = & seg. args {
947
- matches ! (
948
- args_in. deref( ) ,
949
- ast:: GenericArgs :: AngleBracketed ( bracket_args) if bracket_args. args. len( ) > 1
950
- )
951
- } else {
952
- false
944
+ // Whether a GenericBound item is a PathSegment segment that includes internal array
945
+ // that contains more than one item
946
+ let is_item_with_multi_items_array = |item : & ast:: GenericBound | match item {
947
+ ast:: GenericBound :: Trait ( ref poly_trait_ref, ..) => {
948
+ let segments = & poly_trait_ref. trait_ref . path . segments ;
949
+ if segments. len ( ) > 1 {
950
+ true
951
+ } else {
952
+ if let Some ( args_in) = & segments[ 0 ] . args {
953
+ matches ! (
954
+ args_in. deref( ) ,
955
+ ast:: GenericArgs :: AngleBracketed ( bracket_args)
956
+ if bracket_args. args. len( ) > 1
957
+ )
958
+ } else {
959
+ false
960
+ }
961
+ }
953
962
}
963
+ _ => false ,
954
964
} ;
955
965
956
966
let result = items. iter ( ) . enumerate ( ) . try_fold (
@@ -1059,17 +1069,7 @@ fn join_bounds_inner(
1059
1069
if items. len ( ) > 1 {
1060
1070
true
1061
1071
} else {
1062
- match items[ 0 ] {
1063
- ast:: GenericBound :: Trait ( ref poly_trait_ref, ..) => {
1064
- let segments = & poly_trait_ref. trait_ref . path . segments ;
1065
- if segments. len ( ) > 1 {
1066
- true
1067
- } else {
1068
- is_segment_with_multi_items_array ( & segments[ 0 ] )
1069
- }
1070
- }
1071
- _ => false ,
1072
- }
1072
+ is_item_with_multi_items_array ( & items[ 0 ] )
1073
1073
}
1074
1074
} ;
1075
1075
0 commit comments