diff options
| author | est31 <MTest31@outlook.com> | 2020-11-19 08:28:49 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2020-11-19 08:28:49 +0100 |
| commit | de08df26d3e27cf005aaddbb60e02481de4f5866 (patch) | |
| tree | 3eac83d5cb9899dd57d0cf47ae92d595441059d2 /library/core/src/array | |
| parent | 675f114d952df8be61ac74ebeac7550049f26ccd (diff) | |
| download | rust-de08df26d3e27cf005aaddbb60e02481de4f5866.tar.gz rust-de08df26d3e27cf005aaddbb60e02481de4f5866.zip | |
Make as{_mut,}_slice on array::IntoIter public
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/iter.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index cafb002c01a..706f865b4d1 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -69,7 +69,8 @@ impl<T, const N: usize> IntoIter<T, N> { /// Returns an immutable slice of all elements that have not been yielded /// yet. - fn as_slice(&self) -> &[T] { + #[unstable(feature = "array_value_iter_slice", issue = "65798")] + pub fn as_slice(&self) -> &[T] { // SAFETY: We know that all elements within `alive` are properly initialized. unsafe { let slice = self.data.get_unchecked(self.alive.clone()); @@ -78,7 +79,8 @@ impl<T, const N: usize> IntoIter<T, N> { } /// Returns a mutable slice of all elements that have not been yielded yet. - fn as_mut_slice(&mut self) -> &mut [T] { + #[unstable(feature = "array_value_iter_slice", issue = "65798")] + pub fn as_mut_slice(&mut self) -> &mut [T] { // SAFETY: We know that all elements within `alive` are properly initialized. unsafe { let slice = self.data.get_unchecked_mut(self.alive.clone()); |
