Open Jsbjr opened 2 months ago
I'd be against making the bitfields code more complicated. We can add the #[allow(clippy::useless_transmute)]
on the generated code tho...
I would be happy with this solution. I made these changes here: https://github.com/Jsbjr/rust-bindgen/tree/allow-transmute and it seems to work fine. Should I make a PR?
When using bitfields in clippy warns that the transmute in the new, setter and getter are useless. I don't know if it is a false positive from clippy or if the transmutes are indeed uneeded.
Input C/C++ Header
Bindgen Invocation
Main user code
Actual Results
Expected Results
I expect no warnings when using clippy. It is possible to explicitly silence the warning with
#![warn(clippy::useless_transmute)]
but I would prefer not to silence warnings if possible.