Commit Graph

7 Commits

Author SHA1 Message Date
Manish Goregaokar
e9cde416ba Only suggest .copied() for Option right now 2019-04-15 15:44:09 -07:00
Manish Goregaokar
ad2c65bd1b Also suggest .copied() when .clone() is called on a Copy type 2019-04-15 14:39:41 -07:00
Manish Goregaokar
d2f7ae70ae Suggest .copied() instead of .cloned() in map_clone when dealing with references 2019-04-15 14:32:39 -07:00
Grzegorz
16881390e1 removing redundant closures in the whole project 2019-02-10 13:35:44 +01:00
Michael Wright
f53f12b0c3 Fix issue number in map_clone test 2019-01-15 08:17:55 +02:00
Michael Wright
67a9f20c91 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
2019-01-15 08:09:47 +02:00
Wilco Kusee
9ff821a7e8 Add run-rustfix to map_clone test 2019-01-13 13:10:25 +01:00