about summary refs log tree commit diff
path: root/tests/ui/map_clone.rs
AgeCommit message (Collapse)AuthorLines
2019-12-22Fix `map_clone` false positiveMichael Wright-0/+10
Don't lint when the item type is not a reference. `copied` only applies to references.
2019-10-03Test fixesShotaro Yamada-1/+1
2019-05-16Also rename the lint in test filesflip1995-1/+1
2019-05-16Split redundant_closure lintMichael Wright-1/+1
Move the method checking into a new lint called `redundant_closures_for_method_calls` and put it in the pedantic group. This aspect of the lint seems more controversial than the rest. cc #3942
2019-04-15Only suggest .copied() for Option right nowManish Goregaokar-2/+2
2019-04-15Also suggest .copied() when .clone() is called on a Copy typeManish Goregaokar-0/+1
2019-04-15Suggest .copied() instead of .cloned() in map_clone when dealing with referencesManish Goregaokar-0/+1
2019-02-10removing redundant closures in the whole projectGrzegorz-0/+1
2019-01-15Really fix issue number in `map_clone` testMichael Wright-1/+1
2019-01-15Fix `map_clone` bad suggestionMichael Wright-0/+12
`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-13Add run-rustfix to map_clone testWilco Kusee-0/+2
2019-01-08Remove all copyright license headersPhilipp Hansch-9/+0
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2018-12-09rustfmt testsMatthias Krüger-2/+0
2018-10-11Stabilize tool lintsOliver Scherer-1/+1
2018-10-08Don't suggest cloned() for map Box derefRyan Cumming-0/+1
Boxes are a bit magic in that they need to use `*` to get an owned value out of the box. They implement `Deref` but that only returns a reference. This means an easy way to convert an `Option<Box<T>>` to an `<Option<T>` is: ``` box_option.map(|b| *b) ``` However, since b36bb0a6 the `map_clone` lint is detecting this as an attempt to copy the box. Fix by excluding boxes completely from the deref part of this lint. Fixes #3274
2018-10-06Add license header to Rust filesManish Goregaokar-0/+10
2018-10-02Reimplement the `map_clone` lint from scratchOliver Schneider-0/+9
2018-10-02relicensing: Remove map_cloneManish Goregaokar-105/+0
This removes the code added in https://github.com/rust-lang-nursery/rust-clippy/pull/427
2018-08-29Adapt ui-tests to the tool_lintsflip1995-3/+3
2017-10-03Reduce the hackiness of cargo-clippyOliver Schneider-2/+2
2017-08-01Move all our tests back to ui testsOliver Schneider-0/+105
2017-05-17Make most tests an `example` so we can run them one by oneOliver Schneider-105/+0
2017-05-11Address PR commentsOliver Schneider-3/+5
2017-05-10Fixes #443Oliver Schneider-1/+4
2017-02-08remove all //~ from testsOliver Schneider-22/+22
2017-02-07rustup and compile-fail -> ui test moveOliver Schneider-0/+100