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 {
767
767
fmt_bytes( total_size_in_bytes)
768
768
) ?;
769
769
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
+ }
771
775
writeln ! (
772
776
f,
773
777
"{:max_len$.max_len$}\t - {}" ,
Original file line number Diff line number Diff line change @@ -477,7 +477,12 @@ impl fmt::Debug for Allocator {
477
477
fmt_bytes( total_size_in_bytes)
478
478
) ?;
479
479
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
+
481
486
writeln ! (
482
487
f,
483
488
"{:max_len$.max_len$}\t - {}" ,
You can’t perform that action at this time.
0 commit comments