Remove the _ suffix from slice methods.
Deprecates slicing methods from ImmutableSlice/MutableSlice in favour of slicing syntax or the methods in Slice/SliceMut. Closes #17273.
This commit is contained in:
parent
40b9f5ded5
commit
df2f1fa768
7 changed files with 188 additions and 97 deletions
|
|
@ -18,38 +18,38 @@ static mut COUNT: uint = 0;
|
|||
struct Foo;
|
||||
|
||||
impl Slice<Foo, Foo> for Foo {
|
||||
fn as_slice_<'a>(&'a self) -> &'a Foo {
|
||||
fn as_slice<'a>(&'a self) -> &'a Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
fn slice_from_<'a>(&'a self, _from: &Foo) -> &'a Foo {
|
||||
fn slice_from<'a>(&'a self, _from: &Foo) -> &'a Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
fn slice_to_<'a>(&'a self, _to: &Foo) -> &'a Foo {
|
||||
fn slice_to<'a>(&'a self, _to: &Foo) -> &'a Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
fn slice_<'a>(&'a self, _from: &Foo, _to: &Foo) -> &'a Foo {
|
||||
fn slice<'a>(&'a self, _from: &Foo, _to: &Foo) -> &'a Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl SliceMut<Foo, Foo> for Foo {
|
||||
fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Foo {
|
||||
fn as_mut_slice<'a>(&'a mut self) -> &'a mut Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
fn slice_from_mut_<'a>(&'a mut self, _from: &Foo) -> &'a mut Foo {
|
||||
fn slice_from_mut<'a>(&'a mut self, _from: &Foo) -> &'a mut Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
fn slice_to_mut_<'a>(&'a mut self, _to: &Foo) -> &'a mut Foo {
|
||||
fn slice_to_mut<'a>(&'a mut self, _to: &Foo) -> &'a mut Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
fn slice_mut_<'a>(&'a mut self, _from: &Foo, _to: &Foo) -> &'a mut Foo {
|
||||
fn slice_mut<'a>(&'a mut self, _from: &Foo, _to: &Foo) -> &'a mut Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue