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:
parent
fba0bf63a9
commit
092ba6a856
5 changed files with 115 additions and 185 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue