aboutsummaryrefslogtreecommitdiff
path: root/src/flavors/array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/flavors/array.rs')
-rw-r--r--src/flavors/array.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/flavors/array.rs b/src/flavors/array.rs
index c49eef1..871768c 100644
--- a/src/flavors/array.rs
+++ b/src/flavors/array.rs
@@ -10,7 +10,7 @@
use std::cell::UnsafeCell;
use std::marker::PhantomData;
-use std::mem::{self, MaybeUninit};
+use std::mem::MaybeUninit;
use std::ptr;
use std::sync::atomic::{self, AtomicUsize, Ordering};
use std::time::Instant;
@@ -110,7 +110,7 @@ impl<T> Channel<T> {
// Allocate a buffer of `cap` slots initialized
// with stamps.
let buffer = {
- let mut boxed: Box<[Slot<T>]> = (0..cap)
+ let boxed: Box<[Slot<T>]> = (0..cap)
.map(|i| {
// Set the stamp to `{ lap: 0, mark: 0, index: i }`.
Slot {
@@ -119,9 +119,7 @@ impl<T> Channel<T> {
}
})
.collect();
- let ptr = boxed.as_mut_ptr();
- mem::forget(boxed);
- ptr
+ Box::into_raw(boxed) as *mut Slot<T>
};
Channel {