This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 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<'_> {
12851285 . field ( "node" , & self . nodes [ ItemLocalId :: ZERO ] )
12861286 . field (
12871287 "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+ } ) ,
12951295 )
12961296 . field ( "bodies" , & self . bodies )
12971297 . field ( "opt_hash_including_bodies" , & self . opt_hash_including_bodies )
@@ -4638,15 +4638,5 @@ mod size_asserts {
46384638 // tidy-alphabetical-end
46394639}
46404640
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-
46514641#[ cfg( test) ]
46524642mod tests;
Original file line number Diff line number Diff line change 66#![ allow( internal_features) ]
77#![ feature( associated_type_defaults) ]
88#![ feature( closure_track_caller) ]
9+ #![ feature( debug_closure_helpers) ]
910#![ feature( exhaustive_patterns) ]
1011#![ feature( let_chains) ]
1112#![ feature( never_type) ]
You can’t perform that action at this time.
0 commit comments