Skip to content

Commit de08df2

Browse files
committed
Make as{_mut,}_slice on array::IntoIter public
1 parent 675f114 commit de08df2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/core/src/array/iter.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ impl<T, const N: usize> IntoIter<T, N> {
6969

7070
/// Returns an immutable slice of all elements that have not been yielded
7171
/// yet.
72-
fn as_slice(&self) -> &[T] {
72+
#[unstable(feature = "array_value_iter_slice", issue = "65798")]
73+
pub fn as_slice(&self) -> &[T] {
7374
// SAFETY: We know that all elements within `alive` are properly initialized.
7475
unsafe {
7576
let slice = self.data.get_unchecked(self.alive.clone());
@@ -78,7 +79,8 @@ impl<T, const N: usize> IntoIter<T, N> {
7879
}
7980

8081
/// Returns a mutable slice of all elements that have not been yielded yet.
81-
fn as_mut_slice(&mut self) -> &mut [T] {
82+
#[unstable(feature = "array_value_iter_slice", issue = "65798")]
83+
pub fn as_mut_slice(&mut self) -> &mut [T] {
8284
// SAFETY: We know that all elements within `alive` are properly initialized.
8385
unsafe {
8486
let slice = self.data.get_unchecked_mut(self.alive.clone());

0 commit comments

Comments
 (0)