Remove {,r}split_array_ref{,_mut} methods from slices

The functionality of these methods from `split_array` has been absorbed by the
`slice_first_last_chunk` feature. This only affects the methods on slices,
not those with the same name that are implemented on array types.

Also adjusts testing to reflect this change.
This commit is contained in:
Trevor Gross
2023-11-03 20:38:30 -05:00
parent 6e8ec852f7
commit 01337bf1fd
4 changed files with 31 additions and 200 deletions

View File

@@ -647,7 +647,7 @@ impl<T, const N: usize> [T; N] {
)]
#[inline]
pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T]) {
(&self[..]).split_array_ref::<M>()
(&self[..]).split_first_chunk::<M>().unwrap()
}
/// Divides one mutable array reference into two at an index.
@@ -680,7 +680,7 @@ impl<T, const N: usize> [T; N] {
)]
#[inline]
pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T]) {
(&mut self[..]).split_array_mut::<M>()
(&mut self[..]).split_first_chunk_mut::<M>().unwrap()
}
/// Divides one array reference into two at an index from the end.
@@ -725,7 +725,7 @@ impl<T, const N: usize> [T; N] {
)]
#[inline]
pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M]) {
(&self[..]).rsplit_array_ref::<M>()
(&self[..]).split_last_chunk::<M>().unwrap()
}
/// Divides one mutable array reference into two at an index from the end.
@@ -758,7 +758,7 @@ impl<T, const N: usize> [T; N] {
)]
#[inline]
pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M]) {
(&mut self[..]).rsplit_array_mut::<M>()
(&mut self[..]).split_last_chunk_mut::<M>().unwrap()
}
}