Skip to content

Commit 4570f51

Browse files
committed
save header as an intermediate variable
1 parent 1019110 commit 4570f51

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

clippy_lints/src/functions/too_many_arguments.rs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,18 @@ pub(super) fn check_fn(
2121
if !is_trait_impl_item(cx, hir_id) {
2222
// don't lint extern functions decls, it's not their fault either
2323
match kind {
24-
FnKind::Method(
25-
_,
26-
&hir::FnSig {
27-
header: hir::FnHeader {
28-
abi: ExternAbi::Rust, ..
29-
},
30-
..
31-
},
32-
)
33-
| FnKind::ItemFn(
34-
_,
35-
_,
36-
hir::FnHeader {
24+
FnKind::Method(_, &hir::FnSig { header, .. }) | FnKind::ItemFn(_, _, header)
25+
if let hir::FnHeader {
3726
abi: ExternAbi::Rust, ..
38-
},
39-
) => check_arg_number(
40-
cx,
41-
decl,
42-
span.with_hi(decl.output.span().hi()),
43-
too_many_arguments_threshold,
44-
),
27+
} = header =>
28+
{
29+
check_arg_number(
30+
cx,
31+
decl,
32+
span.with_hi(decl.output.span().hi()),
33+
too_many_arguments_threshold,
34+
)
35+
},
4536
_ => {},
4637
}
4738
}

0 commit comments

Comments
 (0)