-
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
identity_op warns for bitflag constant #3430
Comments
I'm not sure if this is really a false positive, since I definitely see your point, but I think this should be handled by |
It's for sure an identity op, but I'd argue that it's not bad style or erroneous, but an important note for what that constant does. It would also be inconsistent to use |
I would suggest to allow |
I agree |
so... generally |
Good question. All seems like a good choice because |
I've just run into this in several places writing code for an embedded target. I agree, I think the pattern |
pyo3 has to map certain constants and flags from the python headers, which includes the code below:
This code raises a warning:
The explanation says:
IMHO
(1 << 0)
is not obscuring the code, but relevant for pointing out that this constant is the first entry in a bitfield. Therefore this is imho a false positive in clippy.cargo clippy -V
: clippy 0.0.212 (a20599a 2018-11-01)The text was updated successfully, but these errors were encountered: