Skip to content

Commit 6934a31

Browse files
Fix logic
1 parent e25bf21 commit 6934a31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/methods/map_clone.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ fn handle_path(
121121
if let ty::Adt(_, args) = cx.typeck_results().expr_ty(recv).kind()
122122
&& let args = args.as_slice()
123123
&& let Some(ty) = args.iter().find_map(|generic_arg| generic_arg.as_type())
124-
&& ty.is_ref()
125124
&& let ty::Ref(_, ty, Mutability::Not) = ty.kind()
126-
&& let ty::FnDef(_, lst) = cx.typeck_results().expr_ty(arg).kind()
127-
&& lst.iter().all(|l| l.as_type() == Some(*ty))
125+
&& let ty::Adt(_, args) = cx.typeck_results().expr_ty(e).kind()
126+
&& let args = args.as_slice()
127+
&& args.iter().find_map(|generic_arg| generic_arg.as_type()) == Some(*ty)
128128
{
129129
lint_path(cx, e.span, recv.span, is_copy(cx, ty.peel_refs()));
130130
}

0 commit comments

Comments
 (0)