Skip to content

Commit 8f6ef40

Browse files
committed
use FnKind::header
1 parent 256429a commit 8f6ef40

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

clippy_lints/src/functions/too_many_arguments.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,13 @@ pub(super) fn check_fn(
2020
// don't warn for implementations, it's not their fault
2121
if !is_trait_impl_item(cx, hir_id) {
2222
// don't lint extern functions decls, it's not their fault either
23-
match kind {
24-
FnKind::Method(_, &hir::FnSig { header, .. }) | FnKind::ItemFn(_, _, header)
25-
if header.abi == ExternAbi::Rust =>
26-
{
27-
check_arg_number(
28-
cx,
29-
decl,
30-
span.with_hi(decl.output.span().hi()),
31-
too_many_arguments_threshold,
32-
)
33-
},
34-
_ => {},
23+
if kind.header().is_some_and(|header| header.abi == ExternAbi::Rust) {
24+
check_arg_number(
25+
cx,
26+
decl,
27+
span.with_hi(decl.output.span().hi()),
28+
too_many_arguments_threshold,
29+
);
3530
}
3631
}
3732
}

0 commit comments

Comments
 (0)