Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maekawatoshiki committed Mar 14, 2024
1 parent 20e4c74 commit 560a5a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/methods/map_clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ fn handle_path(
if let ty::Adt(_, args) = cx.typeck_results().expr_ty(recv).kind()
&& let args = args.as_slice()
&& let Some(ty) = args.iter().find_map(|generic_arg| generic_arg.as_type())
&& ty.is_ref()
&& let ty::Ref(_, ty, Mutability::Not) = ty.kind()
&& let ty::FnDef(_, lst) = cx.typeck_results().expr_ty(arg).kind()
&& lst.iter().all(|l| l.as_type() == Some(*ty))
&& let ty::Adt(_, args) = cx.typeck_results().expr_ty(e).kind()
&& let args = args.as_slice()
&& args.iter().find_map(|generic_arg| generic_arg.as_type()) == Some(*ty)
{
lint_path(cx, e.span, recv.span, is_copy(cx, ty.peel_refs()));
}
Expand Down

0 comments on commit 560a5a8

Please sign in to comment.