-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Recommend contains() for find().is_some() #6010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'd like to tackle this one. |
@pickfire How would you call |
What you said is correct but later when array comes out to have find we need to add it too. |
I am interested on working on this, if @longlb has moved on. I have a good start and should be able to submit a pull request tomorrow. |
Go for it, I'd actually love to see how you did it because I've been unable to figure out a lot of the compiler stuff. |
Ok, great! @pickfire So I made a new lint to do this (basically following the tutorial), but I am wondering if it would be better to instead add this as an extra case of |
@rsulli55 Not quite sure but probably good. Maybe you can take inspiration from |
@pickfire Ok, thanks! I opened a WIP PR for now with what I have but I will be happy to move the code around if it should be placed somewhere else. |
What it does
Recommend
.contains()
iffind().is_some()
is used on a&str
(includingString
) andslice
.Categories (optional)
What is the advantage of the recommended code over the original code
For example:
Drawbacks
None.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: