Skip to content

Commit 70842fc

Browse files
committed
Add doc comments to ArrayBuilder members.
1 parent c84972d commit 70842fc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/next_array.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ use core::ptr;
33

44
/// An array of at most `N` elements.
55
struct ArrayBuilder<T, const N: usize> {
6-
arr: [MaybeUninit<T>; N], // Invariant: arr[..len] is valid.
7-
len: usize, // Invariant: len <= N.
6+
/// The (possibly uninitialized) elements of the `ArrayBuilder`.
7+
///
8+
/// # Safety
9+
///
10+
/// The elements of `arr[..len]` are valid `T`s.
11+
arr: [MaybeUninit<T>; N],
12+
13+
/// The number of leading elements of `arr` that are valid `T`s, len <= N.
14+
len: usize,
815
}
916

1017
impl<T, const N: usize> ArrayBuilder<T, N> {

0 commit comments

Comments
 (0)