diff options
| author | Brian Anderson <banderson@mozilla.com> | 2014-08-06 20:12:48 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-08-13 11:30:15 -0700 |
| commit | d4c736b1f0bd76fc083f1710f16f07e0e15fe6a0 (patch) | |
| tree | ff971a3e328bf284aa041c365b0fdb241a703583 | |
| parent | 033f28d4364e0bd0ff7031b67e6bd0356fe00bfd (diff) | |
core: Deprecate ImmutableSlice::tailn and initn
These are equivalent to slice_from and slice_to.
| -rw-r--r-- | src/libcore/slice.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 8d574376719..0eb97241307 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -163,10 +163,12 @@ pub trait ImmutableSlice<'a, T> { /// Returns all but the first element of a vector fn tail(&self) -> &'a [T]; /// Returns all but the first `n' elements of a vector + #[deprecated = "use slice_from"] fn tailn(&self, n: uint) -> &'a [T]; /// Returns all but the last element of a vector fn init(&self) -> &'a [T]; /// Returns all but the last `n' elements of a vector + #[deprecated = "use slice_to but note the arguments are different"] fn initn(&self, n: uint) -> &'a [T]; /// Returns the last element of a vector, or `None` if it is empty. fn last(&self) -> Option<&'a T>; @@ -339,6 +341,7 @@ impl<'a,T> ImmutableSlice<'a, T> for &'a [T] { fn tail(&self) -> &'a [T] { self.slice(1, self.len()) } #[inline] + #[deprecated = "use slice_from"] fn tailn(&self, n: uint) -> &'a [T] { self.slice(n, self.len()) } #[inline] @@ -347,6 +350,7 @@ impl<'a,T> ImmutableSlice<'a, T> for &'a [T] { } #[inline] + #[deprecated = "use slice_to but note the arguments are different"] fn initn(&self, n: uint) -> &'a [T] { self.slice(0, self.len() - n) } |
