diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2021-03-10 23:40:20 -0600 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2021-03-31 13:25:55 -0500 |
| commit | 21083875d211c29fcfa4a21fcd66d4601d2b618b (patch) | |
| tree | 5fca0ecdaf7382b1cdc39701d39e2eb6d620652c /clippy_lints/src/methods/suspicious_map.rs | |
| parent | 775ef473d7770f375c571004a8ca1ae42983937b (diff) | |
| download | rust-21083875d211c29fcfa4a21fcd66d4601d2b618b.tar.gz rust-21083875d211c29fcfa4a21fcd66d4601d2b618b.zip | |
Destructure args in methods module
Diffstat (limited to 'clippy_lints/src/methods/suspicious_map.rs')
| -rw-r--r-- | clippy_lints/src/methods/suspicious_map.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/clippy_lints/src/methods/suspicious_map.rs b/clippy_lints/src/methods/suspicious_map.rs index 7015bd54c35..0fd0668c734 100644 --- a/clippy_lints/src/methods/suspicious_map.rs +++ b/clippy_lints/src/methods/suspicious_map.rs @@ -8,15 +8,8 @@ use rustc_span::sym; use super::SUSPICIOUS_MAP; -pub fn check<'tcx>( - cx: &LateContext<'tcx>, - expr: &hir::Expr<'_>, - map_args: &[hir::Expr<'_>], - count_args: &[hir::Expr<'_>], -) { +pub fn check<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, count_recv: &hir::Expr<'_>, map_arg: &hir::Expr<'_>) { if_chain! { - if let [count_recv] = count_args; - if let [_, map_arg] = map_args; if is_trait_method(cx, count_recv, sym::Iterator); let closure = expr_or_init(cx, map_arg); if let Some(body_id) = cx.tcx.hir().maybe_body_owned_by(closure.hir_id); |
