diff options
| author | darklyspaced <srohanjd@gmail.com> | 2023-06-26 14:43:36 +0800 |
|---|---|---|
| committer | darklyspaced <srohanjd@gmail.com> | 2023-06-27 11:29:02 +0800 |
| commit | c378bf9ddf10e191fce5753a02a09bb0ab8961fb (patch) | |
| tree | 62fe6dab171533b04b0955f48b2f22dfc3513bcc | |
| parent | b832175b2d51a02fdac3bb8110b71f9a1e1d30b4 (diff) | |
| download | rust-c378bf9ddf10e191fce5753a02a09bb0ab8961fb.tar.gz rust-c378bf9ddf10e191fce5753a02a09bb0ab8961fb.zip | |
Revert "now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple"
This reverts commit 7b91844a3207d90d4200a7b53d0ae1a7a1dca73a.
| -rw-r--r-- | clippy_lints/src/methods/mod.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/methods/option_map_unwrap_or.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index cdabb168912..b1d3b61aea3 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -3906,7 +3906,7 @@ impl Methods { manual_saturating_arithmetic::check(cx, expr, lhs, rhs, u_arg, &arith["checked_".len()..]); }, Some(("map", m_recv, [m_arg], span, _)) => { - option_map_unwrap_or::check(cx, expr, m_recv, m_arg, (recv, u_arg), span, &self.msrv); + option_map_unwrap_or::check(cx, expr, m_recv, m_arg, recv, u_arg, span, &self.msrv); }, Some(("then_some", t_recv, [t_arg], _, _)) => { obfuscated_if_else::check(cx, expr, t_recv, t_arg, u_arg); diff --git a/clippy_lints/src/methods/option_map_unwrap_or.rs b/clippy_lints/src/methods/option_map_unwrap_or.rs index b0d902e6088..4387090fe23 100644 --- a/clippy_lints/src/methods/option_map_unwrap_or.rs +++ b/clippy_lints/src/methods/option_map_unwrap_or.rs @@ -25,11 +25,11 @@ pub(super) fn check<'tcx>( expr: &rustc_hir::Expr<'_>, recv: &rustc_hir::Expr<'_>, map_arg: &'tcx rustc_hir::Expr<'_>, - unwrap: (&rustc_hir::Expr<'_>, &'tcx rustc_hir::Expr<'_>), + unwrap_recv: &rustc_hir::Expr<'_>, + unwrap_arg: &'tcx rustc_hir::Expr<'_>, map_span: Span, msrv: &Msrv, ) { - let (unwrap_recv, unwrap_arg) = unwrap; // lint if the caller of `map()` is an `Option` if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(recv), sym::Option) { if !is_copy(cx, cx.typeck_results().expr_ty(unwrap_arg)) { |
