Remove ::core::mem:: path to size_of#318
Conversation
|
This is kind of hard to review manually, can you instead just make a commit with the result of these steps? |
caf0dfa to
1e8bdbb
Compare
That is basically what i did. :-) Except that i also removed some redundant parentheses. It is now split into two commit, the first from your exact commands, and the second with removed redundant parentheses. I hope it makes it easier to review. |
| if (FSEv05_MAX_TABLELOG * 2 + 7) as size_t | ||
| > (::core::mem::size_of::<size_t>()).wrapping_mul(8) | ||
| { | ||
| if (FSEv05_MAX_TABLELOG * 2 + 7) as size_t > size_of::<size_t>().wrapping_mul(8) { |
There was a problem hiding this comment.
As a followup PR you could also
| if (FSEv05_MAX_TABLELOG * 2 + 7) as size_t > size_of::<size_t>().wrapping_mul(8) { | |
| if (FSEv05_MAX_TABLELOG * 2 + 7) > usize::BITS { |
There was a problem hiding this comment.
The tricky part here is the type conversion which might make this hard to review too.
There was a problem hiding this comment.
Yes. clippy::manual_bits catches this (disabled by default).
There was a problem hiding this comment.
I'm not sure it does catch it with wrapping_mul though, otherwise you could run
RUSTFLAGS="-Aclippy::all -D clippy::manual_bits" cargo clippy --fix --allow-dirty
but that doesn't do anything
size_ofis in the Rust prelude, so use that instead.