refactor: satisfy clippy::manual_bits

This commit is contained in:
Erich Gubler committed 2024-08-13 08:42:41 +01:00
1 parent c72bc7b84b
commit b1eb6db8cd
2 files changed
+2 -3

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ type IdType = u64;
type ZippedIndex = Index;
type NonZeroId = std::num::NonZeroU64;
const INDEX_BITS: usize = std::mem::size_of::<ZippedIndex>() * 8;
const INDEX_BITS: usize = ZippedIndex::BITS as usize;
const EPOCH_BITS: usize = INDEX_BITS - BACKEND_BITS;
const BACKEND_BITS: usize = 3;
const BACKEND_SHIFT: usize = INDEX_BITS * 2 - BACKEND_BITS;
+1 -2
View File
@@ -1,7 +1,6 @@
//! The `ResourceMetadata` type.
use bit_vec::BitVec;
use std::mem;
use wgt::strict_assert;
/// A set of resources, holding a `Arc<T>` and epoch for each member.
@@ -191,7 +190,7 @@ fn resize_bitvec<B: bit_vec::BitBlock>(vec: &mut BitVec<B>, size: usize) {
///
/// Will skip entire usize's worth of bits if they are all false.
fn iterate_bitvec_indices(ownership: &BitVec<usize>) -> impl Iterator<Item = usize> + '_ {
const BITS_PER_BLOCK: usize = mem::size_of::<usize>() * 8;
const BITS_PER_BLOCK: usize = usize::BITS as usize;
let size = ownership.len();