File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -767,7 +767,11 @@ impl fmt::Debug for Allocator {
767767 fmt_bytes( total_size_in_bytes)
768768 ) ?;
769769
770- for alloc in & allocation_report {
770+ let max_num_allocations_to_print = f. precision ( ) . map_or ( usize:: MAX , |n| n) ;
771+ for ( idx, alloc) in allocation_report. iter ( ) . enumerate ( ) {
772+ if idx >= max_num_allocations_to_print {
773+ break ;
774+ }
771775 writeln ! (
772776 f,
773777 "{:max_len$.max_len$}\t - {}" ,
Original file line number Diff line number Diff line change @@ -477,7 +477,12 @@ impl fmt::Debug for Allocator {
477477 fmt_bytes( total_size_in_bytes)
478478 ) ?;
479479
480- for alloc in & allocation_report {
480+ let max_num_allocations_to_print = f. precision ( ) . map_or ( usize:: MAX , |n| n) ;
481+ for ( idx, alloc) in allocation_report. iter ( ) . enumerate ( ) {
482+ if idx >= max_num_allocations_to_print {
483+ break ;
484+ }
485+
481486 writeln ! (
482487 f,
483488 "{:max_len$.max_len$}\t - {}" ,
You can’t perform that action at this time.
0 commit comments