Skip to content

Commit

Permalink
WriteChunk: use PhantomData<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jan 28, 2022
1 parent cefdd81 commit d6d8fe1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
//! ```

use core::fmt;
use core::marker::PhantomData;
use core::mem::MaybeUninit;
use core::sync::atomic::Ordering;

Expand Down Expand Up @@ -321,7 +322,7 @@ impl<T> Consumer<T> {
/// which also allows moving items from an iterator into the ring buffer
/// by means of [`WriteChunkUninit::fill_from_iter()`].
#[derive(Debug, PartialEq, Eq)]
pub struct WriteChunk<'a, T>(Option<WriteChunkUninit<'a, T>>);
pub struct WriteChunk<'a, T>(Option<WriteChunkUninit<'a, T>>, PhantomData<T>);

impl<T> Drop for WriteChunk<'_, T> {
fn drop(&mut self) {
Expand Down Expand Up @@ -352,7 +353,7 @@ where
chunk.second_ptr.add(i).write(Default::default());
}
}
WriteChunk(Some(chunk))
WriteChunk(Some(chunk), PhantomData)
}
}

Expand Down

0 comments on commit d6d8fe1

Please sign in to comment.