4646{
4747 #[ derive( Clone ) ]
4848 struct Param < Name , NodeData > {
49- remaining_depth : usize ,
5049 index_as_child : usize ,
5150 ancestors : Vec < NodeInfo < Name , NodeData > > ,
5251 preceding_sibling : Option < NodeInfo < Name , NodeData > > ,
6968 Size : size:: Size ,
7069 Act : FnMut ( & ' a DataTree < Name , Size > , Param < & ' a Name , Size > ) -> ActResult < & ' a Name , Size > ,
7170 {
72- if param. remaining_depth == 0 {
73- return None ;
74- }
7571 let ActResult { node_info } = act ( tree, param. clone ( ) ) ;
76- let remaining_depth = param. remaining_depth - 1 ;
7772 let mut preceding_sibling = None ;
7873 for ( index_as_child, child) in tree. children ( ) . iter ( ) . enumerate ( ) {
7974 let mut ancestors = Vec :: with_capacity ( param. ancestors . len ( ) + 1 ) ;
8378 child,
8479 act,
8580 Param {
86- remaining_depth,
8781 index_as_child,
8882 ancestors,
8983 preceding_sibling,
@@ -103,18 +97,12 @@ where
10397 let Param {
10498 index_as_child,
10599 ancestors,
106- remaining_depth,
107100 preceding_sibling,
108101 } = param;
109102 let name = node. name ( ) ;
110103 let node_data = node. size ( ) ;
111104 let row_index = initial_table. len ( ) ;
112- debug_assert_op ! ( remaining_depth > 0 ) ;
113- let children_count = if remaining_depth != 1 {
114- node. children ( ) . len ( )
115- } else {
116- 0
117- } ;
105+ let children_count = node. children ( ) . len ( ) ;
118106 let fs_size = node. size ( ) . into ( ) ;
119107 let percentage = if total_fs_size == 0 {
120108 "0%" . to_string ( )
@@ -134,7 +122,6 @@ where
134122 sibling_count,
135123 index_as_child,
136124 children_count,
137- remaining_depth,
138125 } ;
139126
140127 initial_table. column_width . size_column_width =
@@ -151,7 +138,6 @@ where
151138 ActResult { node_info }
152139 } ,
153140 Param {
154- remaining_depth : visualizer. max_depth . get ( ) ,
155141 index_as_child : 0 ,
156142 ancestors : Vec :: new ( ) ,
157143 preceding_sibling : None ,
0 commit comments