-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[as_conversions] No alternative exists to float to/from int conversion using as
#5122
Comments
IMO it is an Allowing this, would defeat the purpose of this lint. For the cases, where Side note: |
I think that's fair, but looking at the cast_* lints, it's not immediately obvious to me that there's a set of lints which would warn me about casts where a better alternative exists, i.e. I.e. it seems reasonable to want |
That is because an int-float-conversion has no alternatives, so we can't warn on |
I guess that's reasonable. Thanks for the help! |
The
as_conversions
lint warns if theas
operator is used for int-to-float and float-to-int conversions, however I don't believe that there is actually an alternative.It might be good to relax the lint so it doesn't complain if either argument is a float until an alternative exists.
The text was updated successfully, but these errors were encountered: