| 1 | //! Bit manipulation utilities. |
|---|---|
| 2 | |
| 3 | /// Tests the `bit` of `x`. |
| 4 | #[allow(dead_code)] |
| 5 | #[inline] |
| 6 | pub(crate) fn test(x: usize, bit: u32) -> bool { |
| 7 | debug_assert!(bit < usize::BITS, "bit index out-of-bounds"); |
| 8 | x & (1 << bit) != 0 |
| 9 | } |
| 10 |
| 1 | //! Bit manipulation utilities. |
|---|---|
| 2 | |
| 3 | /// Tests the `bit` of `x`. |
| 4 | #[allow(dead_code)] |
| 5 | #[inline] |
| 6 | pub(crate) fn test(x: usize, bit: u32) -> bool { |
| 7 | debug_assert!(bit < usize::BITS, "bit index out-of-bounds"); |
| 8 | x & (1 << bit) != 0 |
| 9 | } |
| 10 |