Skip to content

Commit 8f68c89

Browse files
committed
rename recursive function call
1 parent c01597a commit 8f68c89

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

clippy_utils/src/check_proc_macro.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,12 @@ fn ty_search_pat(ty: &Ty<'_>) -> (Pat, Pat) {
410410
}
411411

412412
fn ast_ty_search_pat(ty: &ast::Ty) -> (Pat, Pat) {
413-
match ty.kind {
413+
use ast::{FnRetTy, MutTy, TyKind};
414+
415+
match &ty.kind {
414416
TyKind::Slice(..) | TyKind::Array(..) => (Pat::Str("["), Pat::Str("]")),
415-
TyKind::Ptr(MutTy { ty, .. }) => (Pat::Str("*"), ty_search_pat(ty).1),
416-
TyKind::Ref(_, MutTy { ty, .. }) => (Pat::Str("&"), ty_search_pat(ty).1),
417+
TyKind::Ptr(MutTy { ty, .. }) => (Pat::Str("*"), ast_ty_search_pat(ty).1),
418+
TyKind::Ref(_, MutTy { ty, .. }) => (Pat::Str("&"), ast_ty_search_pat(ty).1),
417419
TyKind::FnPtr(fn_ptr) => (
418420
if fn_ptr.safety.is_unsafe() {
419421
Pat::Str("unsafe")
@@ -425,20 +427,20 @@ fn ast_ty_search_pat(ty: &ast::Ty) -> (Pat, Pat) {
425427
match fn_ptr.decl.output {
426428
FnRetTy::DefaultReturn(_) => {
427429
if let [.., ty] = fn_ptr.decl.inputs {
428-
ty_search_pat(ty).1
430+
ast_ty_search_pat(ty).1
429431
} else {
430432
Pat::Str("(")
431433
}
432434
},
433-
FnRetTy::Return(ty) => ty_search_pat(ty).1,
435+
FnRetTy::Return(ty) => ast_ty_search_pat(ty).1,
434436
},
435437
),
436438
TyKind::Never => (Pat::Str("!"), Pat::Str("!")),
437439
// Parenthesis are trimmed from the text before the search patterns are matched.
438440
// See: `span_matches_pat`
439441
TyKind::Tup([]) => (Pat::Str(")"), Pat::Str("(")),
440-
TyKind::Tup([ty]) => ty_search_pat(ty),
441-
TyKind::Tup([head, .., tail]) => (ty_search_pat(head).0, ty_search_pat(tail).1),
442+
TyKind::Tup([ty]) => ast_ty_search_pat(ty),
443+
TyKind::Tup([head, .., tail]) => (ast_ty_search_pat(head).0, ast_ty_search_pat(tail).1),
442444
TyKind::OpaqueDef(..) => (Pat::Str("impl"), Pat::Str("")),
443445
TyKind::Path(qpath) => qpath_search_pat(&qpath),
444446
TyKind::Infer(()) => (Pat::Str("_"), Pat::Str("_")),

0 commit comments

Comments
 (0)