Skip to content

Commit 44646b9

Browse files
committed
Move only_used_in_recursion back into complexity
1 parent 07f5e64 commit 44646b9

5 files changed

+8
-7
lines changed

clippy_lints/src/lib.register_all.rs

+1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
248248
LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
249249
LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS),
250250
LintId::of(octal_escapes::OCTAL_ESCAPES),
251+
LintId::of(only_used_in_recursion::ONLY_USED_IN_RECURSION),
251252
LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS),
252253
LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP),
253254
LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),

clippy_lints/src/lib.register_complexity.rs

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec!
6868
LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
6969
LintId::of(no_effect::NO_EFFECT),
7070
LintId::of(no_effect::UNNECESSARY_OPERATION),
71+
LintId::of(only_used_in_recursion::ONLY_USED_IN_RECURSION),
7172
LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
7273
LintId::of(partialeq_ne_impl::PARTIALEQ_NE_IMPL),
7374
LintId::of(precedence::PRECEDENCE),

clippy_lints/src/lib.register_nursery.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
2020
LintId::of(mutex_atomic::MUTEX_INTEGER),
2121
LintId::of(non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY),
2222
LintId::of(nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES),
23-
LintId::of(only_used_in_recursion::ONLY_USED_IN_RECURSION),
2423
LintId::of(option_if_let_else::OPTION_IF_LET_ELSE),
2524
LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
2625
LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE),

clippy_lints/src/only_used_in_recursion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ declare_clippy_lint! {
8080
/// ```
8181
#[clippy::version = "1.60.0"]
8282
pub ONLY_USED_IN_RECURSION,
83-
nursery,
83+
complexity,
8484
"arguments that is only used in recursion can be removed"
8585
}
8686
impl_lint_pass!(OnlyUsedInRecursion => [ONLY_USED_IN_RECURSION]);

clippy_lints/src/redundant_static_lifetimes.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ impl_lint_pass!(RedundantStaticLifetimes => [REDUNDANT_STATIC_LIFETIMES]);
4848

4949
impl RedundantStaticLifetimes {
5050
// Recursively visit types
51-
fn visit_type(&mut self, ty: &Ty, cx: &EarlyContext<'_>, reason: &str) {
51+
fn visit_type(ty: &Ty, cx: &EarlyContext<'_>, reason: &str) {
5252
match ty.kind {
5353
// Be careful of nested structures (arrays and tuples)
5454
TyKind::Array(ref ty, _) => {
55-
self.visit_type(&*ty, cx, reason);
55+
Self::visit_type(&*ty, cx, reason);
5656
},
5757
TyKind::Tup(ref tup) => {
5858
for tup_ty in tup {
59-
self.visit_type(&*tup_ty, cx, reason);
59+
Self::visit_type(&*tup_ty, cx, reason);
6060
}
6161
},
6262
// This is what we are looking for !
@@ -87,10 +87,10 @@ impl RedundantStaticLifetimes {
8787
_ => {},
8888
}
8989
}
90-
self.visit_type(&*borrow_type.ty, cx, reason);
90+
Self::visit_type(&*borrow_type.ty, cx, reason);
9191
},
9292
TyKind::Slice(ref ty) => {
93-
self.visit_type(ty, cx, reason);
93+
Self::visit_type(ty, cx, reason);
9494
},
9595
_ => {},
9696
}

0 commit comments

Comments
 (0)