/// Returns all but the first element of a slice.
#[unstable(feature = "slice_extras", reason = "likely to be renamed")]
+ #[deprecated(since = "1.3.0", reason = "superseded by split_first")]
#[inline]
pub fn tail(&self) -> &[T] {
core_slice::SliceExt::tail(self)
}
+ /// Returns the first and all the rest of the elements of a slice.
+ #[unstable(feature = "slice_splits", reason = "new API")]
+ #[inline]
+ pub fn split_first(&self) -> Option<(&T, &[T])> {
+ core_slice::SliceExt::split_first(self)
+ }
+
/// Returns all but the first element of a mutable slice
- #[unstable(feature = "slice_extras",
- reason = "likely to be renamed or removed")]
+ #[unstable(feature = "slice_extras", reason = "likely to be renamed or removed")]
+ #[deprecated(since = "1.3.0", reason = "superseded by split_first_mut")]
#[inline]
pub fn tail_mut(&mut self) -> &mut [T] {
core_slice::SliceExt::tail_mut(self)
}
+ /// Returns the first and all the rest of the elements of a slice.
+ #[unstable(feature = "slice_splits", reason = "new API")]
+ #[inline]
+ pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> {
+ core_slice::SliceExt::split_first_mut(self)
+ }
+
/// Returns all but the last element of a slice.
#[unstable(feature = "slice_extras", reason = "likely to be renamed")]
+ #[deprecated(since = "1.3.0", reason = "superseded by split_last")]
#[inline]
pub fn init(&self) -> &[T] {
core_slice::SliceExt::init(self)
}
+ /// Returns the last and all the rest of the elements of a slice.
+ #[unstable(feature = "slice_splits", reason = "new API")]
+ #[inline]
+ pub fn split_last(&self) -> Option<(&T, &[T])> {
+ core_slice::SliceExt::split_last(self)
+
+ }
+
/// Returns all but the last element of a mutable slice
- #[unstable(feature = "slice_extras",
- reason = "likely to be renamed or removed")]
+ #[unstable(feature = "slice_extras", reason = "likely to be renamed or removed")]
+ #[deprecated(since = "1.3.0", reason = "superseded by split_last_mut")]
#[inline]
pub fn init_mut(&mut self) -> &mut [T] {
core_slice::SliceExt::init_mut(self)
}
+ /// Returns the last and all the rest of the elements of a slice.
+ #[unstable(feature = "slice_splits", since = "1.3.0")]
+ #[inline]
+ pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])> {
+ core_slice::SliceExt::split_last_mut(self)
+ }
+
/// Returns the last element of a slice, or `None` if it is empty.
///
/// # Examples