Deprecate slicing methods in favor of notation

This commit deprecates `slice`, `slice_from`, `slice_to` and their
mutable variants in favor of slice notation.

The `as_slice` methods are left intact, for now.

[breaking-change]
This commit is contained in:
Aaron Turon 2015-01-17 16:15:47 -08:00
parent fba0bf63a9
commit 092ba6a856
5 changed files with 115 additions and 185 deletions

View file

@ -848,6 +848,7 @@ impl<'a> Add<&'a str> for String {
}
}
#[stable]
impl ops::Index<ops::Range<uint>> for String {
type Output = str;
#[inline]
@ -855,6 +856,7 @@ impl ops::Index<ops::Range<uint>> for String {
&self[][*index]
}
}
#[stable]
impl ops::Index<ops::RangeTo<uint>> for String {
type Output = str;
#[inline]
@ -862,6 +864,7 @@ impl ops::Index<ops::RangeTo<uint>> for String {
&self[][*index]
}
}
#[stable]
impl ops::Index<ops::RangeFrom<uint>> for String {
type Output = str;
#[inline]
@ -869,6 +872,7 @@ impl ops::Index<ops::RangeFrom<uint>> for String {
&self[][*index]
}
}
#[stable]
impl ops::Index<ops::FullRange> for String {
type Output = str;
#[inline]