diff options
| author | bors <bors@rust-lang.org> | 2019-05-02 08:45:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-02 08:45:02 +0000 |
| commit | 8151a17422c503ebb52e96d83bf4ce10b2d187e0 (patch) | |
| tree | 9285a7c1000f17f60cad5474e314b436d985a617 /src/test/incremental/thinlto | |
| parent | 1cf5d7f04cc73f99ee19be6b93304666f5845665 (diff) | |
| parent | d063516c85a2d0ae368911bd8ffe3a9459a252ba (diff) | |
| download | rust-8151a17422c503ebb52e96d83bf4ce10b2d187e0.tar.gz rust-8151a17422c503ebb52e96d83bf4ce10b2d187e0.zip | |
Auto merge of #4049 - airt:fix-4033-search_is_some, r=flip1995
Fix #4033 search_is_some
Fixes #4033.
Suggest `any(|x| ..)` instead of `any(|&x| ..)` for `find(|&x| ..).is_some()` (Lint [search_is_some](https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some))
FnDecl of `find`:
```rust
fn find<P>(&mut self, mut p: P) -> Option<Self::Item> where
P: FnMut(&Self::Item) -> bool
```
FnDecl of `any`:
```rust
fn any<F>(&mut self, mut f: F) -> bool where
F: FnMut(Self::Item) -> bool
```
If match on `|&_|` in closure of `find`, only use `|_|` in the suggestion.
PS. It's the first time that I have used the `hir` API, please correct me if there is any mistake 😺
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
