mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 08:57:30 +00:00
Simplify logic
This commit is contained in:
parent
c5d3b62cfc
commit
5f8d8f1656
1 changed files with 2 additions and 3 deletions
|
@ -122,9 +122,8 @@ fn handle_path(
|
||||||
&& let args = args.as_slice()
|
&& let args = args.as_slice()
|
||||||
&& let Some(ty) = args.iter().find_map(|generic_arg| generic_arg.as_type())
|
&& let Some(ty) = args.iter().find_map(|generic_arg| generic_arg.as_type())
|
||||||
&& let ty::Ref(_, ty, Mutability::Not) = ty.kind()
|
&& let ty::Ref(_, ty, Mutability::Not) = ty.kind()
|
||||||
&& let ty::Adt(_, args) = cx.typeck_results().expr_ty(e).kind()
|
&& let ty::FnDef(_, lst) = cx.typeck_results().expr_ty(arg).kind()
|
||||||
&& let args = args.as_slice()
|
&& lst.iter().all(|l| l.as_type() == Some(*ty))
|
||||||
&& 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()));
|
lint_path(cx, e.span, recv.span, is_copy(cx, ty.peel_refs()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue