Skip to content

Commit

Permalink
minor linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yaleman committed Jun 26, 2024
1 parent dd7bdab commit a953cf2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/arcache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2962,9 +2962,10 @@ mod tests {
}

#[allow(dead_code)]

pub static RUNNING: AtomicBool = AtomicBool::new(false);

#[allow(dead_code)]
#[cfg(test)]
fn multi_thread_worker(arc: Arc<ARCache<Box<u32>, Box<u32>>>) {
while RUNNING.load(Ordering::Relaxed) {
let mut rd_txn = arc.read();
Expand All @@ -2982,6 +2983,7 @@ mod tests {
#[allow(dead_code)]
#[cfg_attr(miri, ignore)]
#[cfg_attr(feature = "dhat-heap", test)]
#[cfg(test)]
fn test_cache_stress_1() {
#[cfg(feature = "dhat-heap")]
let _profiler = dhat::Profiler::builder().trim_backtraces(None).build();
Expand Down
13 changes: 7 additions & 6 deletions src/internals/hashtrie/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ use std::hash::{BuildHasher, Hash, Hasher};
#[cfg(feature = "hashtrie_skinny")]
pub(crate) const MAX_HEIGHT: u64 = 8;
// The true absolute max height
#[cfg(feature = "hashtrie_skinny")]
#[cfg(test)]
#[cfg(all(feature = "hashtrie_skinny", any(test, debug_assertions)))]
const ABS_MAX_HEIGHT: u64 = 21;
#[cfg(feature = "hashtrie_skinny")]
pub(crate) const HT_CAPACITY: usize = 8;
Expand All @@ -47,8 +46,7 @@ const SHIFT: u64 = 3;
// This defines the max height of our tree. Gives 16777216.0 entries
#[cfg(not(feature = "hashtrie_skinny"))]
pub(crate) const MAX_HEIGHT: u64 = 6;
#[cfg(not(feature = "hashtrie_skinny"))]
#[cfg(test)]
#[cfg(all(not(feature = "hashtrie_skinny"), any(test, debug_assertions)))]
const ABS_MAX_HEIGHT: u64 = 16;
#[cfg(not(feature = "hashtrie_skinny"))]
pub(crate) const HT_CAPACITY: usize = 16;
Expand Down Expand Up @@ -418,8 +416,11 @@ where
impl<K: Hash + Eq + Clone + Debug, V: Clone> SuperBlock<K, V> {
/// 🔥 🔥 🔥
pub unsafe fn new() -> Self {
#[cfg(debug)]
assert!(MAX_HEIGHT <= ABS_MAX_HEIGHT);
#[allow(clippy::assertions_on_constants)]
{
#[cfg(any(test, debug_assertions))]
assert!(MAX_HEIGHT <= ABS_MAX_HEIGHT);
}

let b: Box<Branch<K, V>> = Branch::new();
let root = Ptr::from(b);
Expand Down

0 comments on commit a953cf2

Please sign in to comment.