You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bit unsure about with category it should be in. I would probably lean mostly towards style. Since it's a bit hard to evaluate the performance after optimization. Though the performance hit is quite evident in debug mode.
Also not sure if this lint should deal with the case of arr != [] and suggest !arr.is_empty()?
I would like to try and hack on this lint if it seems like something that's useful
What it does
Suggest using
is_empty()
instead of checking for equality with an empty slice== []
or== ""
to be more consistent with similar lints such aslen_zero
Categories (optional)
What is the advantage of the recommended code over the original code
len_zero
so that we suggest lints for bothstr.len() == 0
andstr == ""
is_empty()
Drawbacks
None.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: