Skip to content

Commit dda9d7c

Browse files
committed
Fix for remaining clippy warnings
1 parent 5e66561 commit dda9d7c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/mpmc.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ pub type MpMcQueue<T, const N: usize> = MpMcQueueInner<T, OwnedStorage<N>>;
151151
pub type MpMcQueueView<T> = MpMcQueueInner<T, ViewStorage>;
152152

153153
impl<T, const N: usize> MpMcQueue<T, N> {
154-
const EMPTY_CELL: Cell<T> = Cell::new(0);
155-
156154
const ASSERT: [(); 1] = [()];
157155

158156
/// Creates an empty queue
@@ -167,7 +165,7 @@ impl<T, const N: usize> MpMcQueue<T, N> {
167165

168166
let mut cell_count = 0;
169167

170-
let mut result_cells: [Cell<T>; N] = [Self::EMPTY_CELL; N];
168+
let mut result_cells: [Cell<T>; N] = [const { Cell::new(0) }; N];
171169
while cell_count != N {
172170
result_cells[cell_count] = Cell::new(cell_count);
173171
cell_count += 1;

src/spsc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ pub type Queue<T, const N: usize> = QueueInner<T, OwnedStorage<N>>;
135135
pub type QueueView<T> = QueueInner<T, ViewStorage>;
136136

137137
impl<T, const N: usize> Queue<T, N> {
138-
const INIT: UnsafeCell<MaybeUninit<T>> = UnsafeCell::new(MaybeUninit::uninit());
139138
/// Creates an empty queue with a fixed capacity of `N - 1`
140139
pub const fn new() -> Self {
141140
// Const assert N > 1
@@ -144,7 +143,7 @@ impl<T, const N: usize> Queue<T, N> {
144143
Queue {
145144
head: AtomicUsize::new(0),
146145
tail: AtomicUsize::new(0),
147-
buffer: [Self::INIT; N],
146+
buffer: [const { UnsafeCell::new(MaybeUninit::uninit()) }; N],
148147
}
149148
}
150149

0 commit comments

Comments
 (0)