File tree 2 files changed +8
-17
lines changed
2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -1285,13 +1285,13 @@ impl fmt::Debug for OwnerNodes<'_> {
1285
1285
. field ( "node" , & self . nodes [ ItemLocalId :: ZERO ] )
1286
1286
. field (
1287
1287
"parents" ,
1288
- & self
1289
- . nodes
1290
- . iter_enumerated ( )
1291
- . map ( | ( id , parented_node ) | {
1292
- debug_fn ( move |f| write ! ( f , "({id:?}, {:?})" , parented_node . parent ) )
1293
- } )
1294
- . collect :: < Vec < _ > > ( ) ,
1288
+ & fmt :: from_fn ( |f| {
1289
+ f . debug_list ( )
1290
+ . entries ( self . nodes . iter_enumerated ( ) . map ( | ( id , parented_node ) | {
1291
+ fmt :: from_fn ( move |f| write ! ( f , "({id:?}, {:?})" , parented_node . parent ) )
1292
+ } ) )
1293
+ . finish ( )
1294
+ } ) ,
1295
1295
)
1296
1296
. field ( "bodies" , & self . bodies )
1297
1297
. field ( "opt_hash_including_bodies" , & self . opt_hash_including_bodies )
@@ -4638,15 +4638,5 @@ mod size_asserts {
4638
4638
// tidy-alphabetical-end
4639
4639
}
4640
4640
4641
- fn debug_fn ( f : impl Fn ( & mut fmt:: Formatter < ' _ > ) -> fmt:: Result ) -> impl fmt:: Debug {
4642
- struct DebugFn < F > ( F ) ;
4643
- impl < F : Fn ( & mut fmt:: Formatter < ' _ > ) -> fmt:: Result > fmt:: Debug for DebugFn < F > {
4644
- fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
4645
- ( self . 0 ) ( fmt)
4646
- }
4647
- }
4648
- DebugFn ( f)
4649
- }
4650
-
4651
4641
#[ cfg( test) ]
4652
4642
mod tests;
Original file line number Diff line number Diff line change 6
6
#![ allow( internal_features) ]
7
7
#![ feature( associated_type_defaults) ]
8
8
#![ feature( closure_track_caller) ]
9
+ #![ feature( debug_closure_helpers) ]
9
10
#![ feature( exhaustive_patterns) ]
10
11
#![ feature( let_chains) ]
11
12
#![ feature( never_type) ]
You can’t perform that action at this time.
0 commit comments