-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
use of round/floor/ceil on known integer value #39
Comments
FWIW I don't think we'll have too many issues with constants -- I think programmers will be smart enough to not do stuff like this (but footguns like the other issues on this repo would be harder to catch manually) Still, I don't mind having stuff like this here. |
I just nicked it from FindBugs. And yes, I don't think it should be high priority. |
What should this lint catch? For example, using |
Happy to jump in and take this 🎈 |
From what I can see,
Is there some more specific requirements for what this lint should catch @llogiq If not, perhaps this issue be closed? |
Perhaps this lint is just for cases where the operation doesn't change the value? |
Yes, that was pseudocode This lint is about calling |
@rustbot claim |
For constants you can take a look at I've you're stuck on an implementation detail, feel free to reach out or create a draft PR 🙃 |
@xFrednet I think that's good point. I'll start working on a PR today |
E.g. ceil(1f32)
The text was updated successfully, but these errors were encountered: