Skip to content

Commit 31af451

Browse files
committed
Make Array Consumer/Builder structures public, but hidden, for use in other APIs
1 parent 95d57f4 commit 31af451

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/lib.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,20 +161,23 @@ where
161161
}
162162
}
163163

164-
struct ArrayBuilder<T, N: ArrayLength<T>> {
165-
array: ManuallyDrop<GenericArray<T, N>>,
166-
position: usize,
164+
#[doc(hidden)]
165+
pub struct ArrayBuilder<T, N: ArrayLength<T>> {
166+
pub array: ManuallyDrop<GenericArray<T, N>>,
167+
pub position: usize,
167168
}
168169

169170
impl<T, N: ArrayLength<T>> ArrayBuilder<T, N> {
170-
fn new() -> ArrayBuilder<T, N> {
171+
#[doc(hidden)]
172+
pub fn new() -> ArrayBuilder<T, N> {
171173
ArrayBuilder {
172174
array: ManuallyDrop::new(unsafe { mem::uninitialized() }),
173175
position: 0,
174176
}
175177
}
176178

177-
fn into_inner(self) -> GenericArray<T, N> {
179+
#[doc(hidden)]
180+
pub fn into_inner(self) -> GenericArray<T, N> {
178181
let array = unsafe { ptr::read(&self.array) };
179182

180183
mem::forget(self);
@@ -193,13 +196,15 @@ impl<T, N: ArrayLength<T>> Drop for ArrayBuilder<T, N> {
193196
}
194197
}
195198

196-
struct ArrayConsumer<T, N: ArrayLength<T>> {
197-
array: ManuallyDrop<GenericArray<T, N>>,
198-
position: usize,
199+
#[doc(hidden)]
200+
pub struct ArrayConsumer<T, N: ArrayLength<T>> {
201+
pub array: ManuallyDrop<GenericArray<T, N>>,
202+
pub position: usize,
199203
}
200204

201205
impl<T, N: ArrayLength<T>> ArrayConsumer<T, N> {
202-
fn new(array: GenericArray<T, N>) -> ArrayConsumer<T, N> {
206+
#[doc(hidden)]
207+
pub fn new(array: GenericArray<T, N>) -> ArrayConsumer<T, N> {
203208
ArrayConsumer {
204209
array: ManuallyDrop::new(array),
205210
position: 0,

0 commit comments

Comments
 (0)