Skip to content

Commit 08cc1f7

Browse files
committed
remove unused arguments
1 parent 96855e3 commit 08cc1f7

File tree

4 files changed

+6
-21
lines changed

4 files changed

+6
-21
lines changed

clippy_lints/src/methods/filter_flat_map.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ use rustc_span::sym;
77
use super::FILTER_MAP;
88

99
/// lint use of `filter().flat_map()` for `Iterators`
10-
pub(super) fn check<'tcx>(
11-
cx: &LateContext<'tcx>,
12-
expr: &'tcx hir::Expr<'_>,
13-
_filter_args: &'tcx [hir::Expr<'_>],
14-
_map_args: &'tcx [hir::Expr<'_>],
15-
) {
10+
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
1611
// lint if caller of `.filter().flat_map()` is an Iterator
1712
if is_trait_method(cx, expr, sym::Iterator) {
1813
let msg = "called `filter(..).flat_map(..)` on an `Iterator`";

clippy_lints/src/methods/filter_map_flat_map.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ use rustc_span::sym;
77
use super::FILTER_MAP;
88

99
/// lint use of `filter_map().flat_map()` for `Iterators`
10-
pub(super) fn check<'tcx>(
11-
cx: &LateContext<'tcx>,
12-
expr: &'tcx hir::Expr<'_>,
13-
_filter_args: &'tcx [hir::Expr<'_>],
14-
_map_args: &'tcx [hir::Expr<'_>],
15-
) {
10+
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
1611
// lint if caller of `.filter_map().flat_map()` is an Iterator
1712
if is_trait_method(cx, expr, sym::Iterator) {
1813
let msg = "called `filter_map(..).flat_map(..)` on an `Iterator`";

clippy_lints/src/methods/filter_map_map.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ use rustc_span::sym;
77
use super::FILTER_MAP;
88

99
/// lint use of `filter_map().map()` for `Iterators`
10-
pub(super) fn check<'tcx>(
11-
cx: &LateContext<'tcx>,
12-
expr: &'tcx hir::Expr<'_>,
13-
_filter_args: &'tcx [hir::Expr<'_>],
14-
_map_args: &'tcx [hir::Expr<'_>],
15-
) {
10+
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
1611
// lint if caller of `.filter_map().map()` is an Iterator
1712
if is_trait_method(cx, expr, sym::Iterator) {
1813
let msg = "called `filter_map(..).map(..)` on an `Iterator`";

clippy_lints/src/methods/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1716,11 +1716,11 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
17161716
["next", "skip_while"] => skip_while_next::check(cx, expr, arg_lists[1]),
17171717
["next", "iter"] => iter_next_slice::check(cx, expr, arg_lists[1]),
17181718
["map", "filter"] => filter_map::check(cx, expr, false),
1719-
["map", "filter_map"] => filter_map_map::check(cx, expr, arg_lists[1], arg_lists[0]),
1719+
["map", "filter_map"] => filter_map_map::check(cx, expr),
17201720
["next", "filter_map"] => filter_map_next::check(cx, expr, arg_lists[1], self.msrv.as_ref()),
17211721
["map", "find"] => filter_map::check(cx, expr, true),
1722-
["flat_map", "filter"] => filter_flat_map::check(cx, expr, arg_lists[1], arg_lists[0]),
1723-
["flat_map", "filter_map"] => filter_map_flat_map::check(cx, expr, arg_lists[1], arg_lists[0]),
1722+
["flat_map", "filter"] => filter_flat_map::check(cx, expr),
1723+
["flat_map", "filter_map"] => filter_map_flat_map::check(cx, expr),
17241724
["flat_map", ..] => flat_map_identity::check(cx, expr, arg_lists[0], method_spans[0]),
17251725
["flatten", "map"] => map_flatten::check(cx, expr, arg_lists[1]),
17261726
["is_some", "find"] => search_is_some::check(cx, expr, "find", arg_lists[1], arg_lists[0], method_spans[1]),

0 commit comments

Comments
 (0)