@@ -282,9 +282,9 @@ fn expand_subtree<S: Span>(
282282 }
283283
284284 let res = if ctx. new_meta_vars {
285- count ( ctx , binding, 0 , depth. unwrap_or ( 0 ) )
285+ count ( binding, 0 , depth. unwrap_or ( 0 ) )
286286 } else {
287- count_old ( ctx , binding, 0 , * depth)
287+ count_old ( binding, 0 , * depth)
288288 } ;
289289
290290 let c = match res {
@@ -537,7 +537,6 @@ fn fix_up_and_push_path_tt<S: Span>(
537537/// Handles `${count(t, depth)}`. `our_depth` is the recursion depth and `count_depth` is the depth
538538/// defined by the metavar expression.
539539fn count < S > (
540- ctx : & ExpandCtx < ' _ , S > ,
541540 binding : & Binding < S > ,
542541 depth_curr : usize ,
543542 depth_max : usize ,
@@ -547,7 +546,7 @@ fn count<S>(
547546 if depth_curr == depth_max {
548547 Ok ( bs. len ( ) )
549548 } else {
550- bs. iter ( ) . map ( |b| count ( ctx , b, depth_curr + 1 , depth_max) ) . sum ( )
549+ bs. iter ( ) . map ( |b| count ( b, depth_curr + 1 , depth_max) ) . sum ( )
551550 }
552551 }
553552 Binding :: Empty => Ok ( 0 ) ,
@@ -556,16 +555,15 @@ fn count<S>(
556555}
557556
558557fn count_old < S > (
559- ctx : & ExpandCtx < ' _ , S > ,
560558 binding : & Binding < S > ,
561559 our_depth : usize ,
562560 count_depth : Option < usize > ,
563561) -> Result < usize , CountError > {
564562 match binding {
565563 Binding :: Nested ( bs) => match count_depth {
566- None => bs. iter ( ) . map ( |b| count_old ( ctx , b, our_depth + 1 , None ) ) . sum ( ) ,
564+ None => bs. iter ( ) . map ( |b| count_old ( b, our_depth + 1 , None ) ) . sum ( ) ,
567565 Some ( 0 ) => Ok ( bs. len ( ) ) ,
568- Some ( d) => bs. iter ( ) . map ( |b| count_old ( ctx , b, our_depth + 1 , Some ( d - 1 ) ) ) . sum ( ) ,
566+ Some ( d) => bs. iter ( ) . map ( |b| count_old ( b, our_depth + 1 , Some ( d - 1 ) ) ) . sum ( ) ,
569567 } ,
570568 Binding :: Empty => Ok ( 0 ) ,
571569 Binding :: Fragment ( _) | Binding :: Missing ( _) => {
0 commit comments