Skip to content

Commit

Permalink
Use ::BITS to compute sizes instead of size_of.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctamblyn committed Aug 24, 2023
1 parent a968610 commit 4f7014e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.33.0"
msrv = "1.53.0"
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
#![no_std]
#![doc(html_root_url = "https://docs.rs/bit-iter/1.1.1")]

use core::{
iter::{ExactSizeIterator, FusedIterator},
mem::size_of,
};
use core::iter::{ExactSizeIterator, FusedIterator};

#[cfg(test)]
mod tests;
Expand Down Expand Up @@ -90,7 +87,7 @@ macro_rules! iter_impl {

#[inline]
fn leftmost_one_pos(&self) -> usize {
8 * size_of::<$t>() - 1 - self.0.leading_zeros() as usize
(<$t>::BITS - 1 - self.0.leading_zeros()) as usize
}

#[inline]
Expand Down

0 comments on commit 4f7014e

Please sign in to comment.