Skip to content

Commit 7b91844

Browse files
committed
now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple
was previously failing due to `check` having to many arguments.
1 parent 9d2e7f3 commit 7b91844

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/methods/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3906,7 +3906,7 @@ impl Methods {
39063906
manual_saturating_arithmetic::check(cx, expr, lhs, rhs, u_arg, &arith["checked_".len()..]);
39073907
},
39083908
Some(("map", m_recv, [m_arg], span, _)) => {
3909-
option_map_unwrap_or::check(cx, expr, m_recv, m_arg, recv, u_arg, span, &self.msrv);
3909+
option_map_unwrap_or::check(cx, expr, m_recv, m_arg, (recv, u_arg), span, &self.msrv);
39103910
},
39113911
Some(("then_some", t_recv, [t_arg], _, _)) => {
39123912
obfuscated_if_else::check(cx, expr, t_recv, t_arg, u_arg);

clippy_lints/src/methods/option_map_unwrap_or.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ pub(super) fn check<'tcx>(
2525
expr: &rustc_hir::Expr<'_>,
2626
recv: &rustc_hir::Expr<'_>,
2727
map_arg: &'tcx rustc_hir::Expr<'_>,
28-
unwrap_recv: &rustc_hir::Expr<'_>,
29-
unwrap_arg: &'tcx rustc_hir::Expr<'_>,
28+
unwrap: (&rustc_hir::Expr<'_>, &'tcx rustc_hir::Expr<'_>),
3029
map_span: Span,
3130
msrv: &Msrv,
3231
) {
32+
let (unwrap_recv, unwrap_arg) = unwrap;
3333
// lint if the caller of `map()` is an `Option`
3434
if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(recv), sym::Option) {
3535
if !is_copy(cx, cx.typeck_results().expr_ty(unwrap_arg)) {

0 commit comments

Comments
 (0)