Merge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyup

This commit is contained in:
flip1995
2021-09-08 16:31:47 +02:00
parent f7aaa2a200
commit 091ed44b50
183 changed files with 4171 additions and 1313 deletions

View File

@@ -24,9 +24,9 @@ pub(super) fn derefs_to_slice<'tcx>(
}
}
if let hir::ExprKind::MethodCall(path, _, args, _) = expr.kind {
if path.ident.name == sym::iter && may_slice(cx, cx.typeck_results().expr_ty(&args[0])) {
Some(&args[0])
if let hir::ExprKind::MethodCall(path, _, [self_arg, ..], _) = &expr.kind {
if path.ident.name == sym::iter && may_slice(cx, cx.typeck_results().expr_ty(self_arg)) {
Some(self_arg)
} else {
None
}