diff --git a/syncpool/src/bucket.rs b/syncpool/src/bucket.rs index 52baa9f..788c509 100644 --- a/syncpool/src/bucket.rs +++ b/syncpool/src/bucket.rs @@ -355,13 +355,12 @@ impl RingBucket { /// make sure the bitmap is updated as well. pub(crate) fn new(filler: Option<&ElemBuilder>) -> Self { // create the placeholder - let mut slice: [AtomicPtr; SLOT_CAP] = - [AtomicPtr::new(ptr::null_mut()); SLOT_CAP]; + let mut slice: [AtomicPtr; SLOT_CAP] = Default::default(); // fill the slots and update the bitmap if let Some(handle) = filler { for (_, item) in slice.iter_mut().enumerate() { - item.swap(Box::into_raw(make_elem(handle), Ordering::SeqCst); + item.swap(Box::into_raw(make_elem(handle)), Ordering::SeqCst); } }