Skip to content

Commit 0df3049

Browse files
committed
only_used_in_recursion
1 parent bef3551 commit 0df3049

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ needless_doctest_main = "allow"
179179
new_without_default = "allow"
180180
non_canonical_clone_impl = "allow"
181181
non_canonical_partial_ord_impl = "allow"
182-
only_used_in_recursion = "allow"
183182
op_ref = "allow"
184183
option_map_unit_fn = "allow"
185184
partialeq_to_none = "allow"

crates/ide-ssr/src/matching.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
310310
Ok(())
311311
}
312312

313+
#[allow(clippy::only_used_in_recursion)]
313314
fn check_constraint(
314315
&self,
315316
constraint: &Constraint,

crates/mbe/src/expander/transcriber.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
539539
fn 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

558557
fn 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

Comments
 (0)