-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 😺
- Loading branch information
Showing
2 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters