blob: 1b89724b4889aef631b40d52c0943bdc28e04d1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
tree 54a883b990dcbf6ec10cb70335d93e85577ddc07
parent 19553aee2cef35cb3b3409128f76f3819a43b925
parent 89de4c9766eeecd791c789ef63aab9df4b9d906c
author bors <bors@rust-lang.org> 1547543049 +0000
committer bors <bors@rust-lang.org> 1547543049 +0000
Auto merge of #3662 - mikerite:fix-498, r=oli-obk
Fix `map_clone` bad suggestion
`cloned` requires that the elements of the iterator must be references. This
change determines if that is the case by examining the type of the closure
argument and suggesting `.cloned` only if it is a reference. When the closure
argument is not a reference, it suggests removing the `map` call instead.
A minor problem with this change is that the new check sometimes overlaps
with the `clone_on_copy` lint.
Fixes #498
|