Skip to content

Commit

Permalink
Fix for remaining clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcebox committed Oct 7, 2024
1 parent 5e66561 commit dda9d7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/mpmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ pub type MpMcQueue<T, const N: usize> = MpMcQueueInner<T, OwnedStorage<N>>;
pub type MpMcQueueView<T> = MpMcQueueInner<T, ViewStorage>;

impl<T, const N: usize> MpMcQueue<T, N> {
const EMPTY_CELL: Cell<T> = Cell::new(0);

const ASSERT: [(); 1] = [()];

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

let mut cell_count = 0;

let mut result_cells: [Cell<T>; N] = [Self::EMPTY_CELL; N];
let mut result_cells: [Cell<T>; N] = [const { Cell::new(0) }; N];
while cell_count != N {
result_cells[cell_count] = Cell::new(cell_count);
cell_count += 1;
Expand Down
3 changes: 1 addition & 2 deletions src/spsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ pub type Queue<T, const N: usize> = QueueInner<T, OwnedStorage<N>>;
pub type QueueView<T> = QueueInner<T, ViewStorage>;

impl<T, const N: usize> Queue<T, N> {
const INIT: UnsafeCell<MaybeUninit<T>> = UnsafeCell::new(MaybeUninit::uninit());
/// Creates an empty queue with a fixed capacity of `N - 1`
pub const fn new() -> Self {
// Const assert N > 1
Expand All @@ -144,7 +143,7 @@ impl<T, const N: usize> Queue<T, N> {
Queue {
head: AtomicUsize::new(0),
tail: AtomicUsize::new(0),
buffer: [Self::INIT; N],
buffer: [const { UnsafeCell::new(MaybeUninit::uninit()) }; N],
}
}

Expand Down

0 comments on commit dda9d7c

Please sign in to comment.