Skip to content

Commit

Permalink
Fixed clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaveaux committed Sep 25, 2023
1 parent 281452c commit 89d471d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmarks/benches/vec_benchmarks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{
hint::black_box,
sync::{atomic::AtomicBool, Arc, Barrier, RwLock, Mutex},
sync::{atomic::AtomicBool, Arc, Barrier},
thread::{self},
};

Expand Down Expand Up @@ -135,7 +135,7 @@ pub fn benchmark_vector(c: &mut Criterion) {
black_box(x.vector.push(1));
},
num_threads,
10000,
NUM_ITERATIONS,
read_ratio);
}
}
Expand Down
10 changes: 10 additions & 0 deletions bf-vec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ impl<T> BfVec<T> {
self.shared.read().unwrap().len.load(Ordering::Relaxed)
}

pub fn is_empty(&self) -> bool {
self.len() == 0
}

/// Allocate the vector to be twice as long.
fn reserve(&self, capacity: usize) {
let mut write = self.shared.write().unwrap();
Expand All @@ -98,6 +102,12 @@ impl<T> BfVec<T> {
}
}

impl<T> Default for BfVec<T> {
fn default() -> Self {
Self::new()
}
}

impl<T> Drop for BfVecShared<T> {
fn drop(&mut self) {

Expand Down
1 change: 1 addition & 0 deletions xtask/src/sanitizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::error::Error;
pub use duct::cmd;

#[cfg(not(unix))]
#[allow(clippy::ptr_arg)]
fn add_target_flag(_arguments: &mut Vec<String>) {}

#[cfg(target_os = "linux")]
Expand Down

0 comments on commit 89d471d

Please sign in to comment.