@@ -169,29 +169,16 @@ pub trait SliceExt {
169
169
#[ unstable = "uncertain about this API approach" ]
170
170
fn move_from ( & mut self , src : Vec < Self :: Item > , start : uint , end : uint ) -> uint ;
171
171
172
- /// Returns a subslice spanning the interval [`start`, `end`).
173
- ///
174
- /// Panics when the end of the new slice lies beyond the end of the
175
- /// original slice (i.e. when `end > self.len()`) or when `start > end`.
176
- ///
177
- /// Slicing with `start` equal to `end` yields an empty slice.
178
- #[ unstable = "will be replaced by slice syntax" ]
172
+ /// Deprecated: use `&s[start .. end]` notation instead.
173
+ #[ deprecated = "use &s[start .. end] instead" ]
179
174
fn slice ( & self , start : uint , end : uint ) -> & [ Self :: Item ] ;
180
175
181
- /// Returns a subslice from `start` to the end of the slice.
182
- ///
183
- /// Panics when `start` is strictly greater than the length of the original slice.
184
- ///
185
- /// Slicing from `self.len()` yields an empty slice.
186
- #[ unstable = "will be replaced by slice syntax" ]
176
+ /// Deprecated: use `&s[start..]` notation instead.
177
+ #[ deprecated = "use &s[start..] isntead" ]
187
178
fn slice_from ( & self , start : uint ) -> & [ Self :: Item ] ;
188
179
189
- /// Returns a subslice from the start of the slice to `end`.
190
- ///
191
- /// Panics when `end` is strictly greater than the length of the original slice.
192
- ///
193
- /// Slicing to `0` yields an empty slice.
194
- #[ unstable = "will be replaced by slice syntax" ]
180
+ /// Deprecated: use `&s[..end]` notation instead.
181
+ #[ deprecated = "use &s[..end] instead" ]
195
182
fn slice_to ( & self , end : uint ) -> & [ Self :: Item ] ;
196
183
197
184
/// Divides one slice into two at an index.
@@ -378,29 +365,16 @@ pub trait SliceExt {
378
365
#[ stable]
379
366
fn as_mut_slice ( & mut self ) -> & mut [ Self :: Item ] ;
380
367
381
- /// Returns a mutable subslice spanning the interval [`start`, `end`).
382
- ///
383
- /// Panics when the end of the new slice lies beyond the end of the
384
- /// original slice (i.e. when `end > self.len()`) or when `start > end`.
385
- ///
386
- /// Slicing with `start` equal to `end` yields an empty slice.
387
- #[ unstable = "will be replaced by slice syntax" ]
368
+ /// Deprecated: use `&mut s[start .. end]` instead.
369
+ #[ deprecated = "use &mut s[start .. end] instead" ]
388
370
fn slice_mut ( & mut self , start : uint , end : uint ) -> & mut [ Self :: Item ] ;
389
371
390
- /// Returns a mutable subslice from `start` to the end of the slice.
391
- ///
392
- /// Panics when `start` is strictly greater than the length of the original slice.
393
- ///
394
- /// Slicing from `self.len()` yields an empty slice.
395
- #[ unstable = "will be replaced by slice syntax" ]
372
+ /// Deprecated: use `&mut s[start ..]` instead.
373
+ #[ deprecated = "use &mut s[start ..] instead" ]
396
374
fn slice_from_mut ( & mut self , start : uint ) -> & mut [ Self :: Item ] ;
397
375
398
- /// Returns a mutable subslice from the start of the slice to `end`.
399
- ///
400
- /// Panics when `end` is strictly greater than the length of the original slice.
401
- ///
402
- /// Slicing to `0` yields an empty slice.
403
- #[ unstable = "will be replaced by slice syntax" ]
376
+ /// Deprecated: use `&mut s[.. end]` instead.
377
+ #[ deprecated = "use &mut s[.. end] instead" ]
404
378
fn slice_to_mut ( & mut self , end : uint ) -> & mut [ Self :: Item ] ;
405
379
406
380
/// Returns an iterator that allows modifying each value
@@ -720,17 +694,17 @@ impl<T> SliceExt for [T] {
720
694
721
695
#[ inline]
722
696
fn slice < ' a > ( & ' a self , start : uint , end : uint ) -> & ' a [ T ] {
723
- core_slice :: SliceExt :: slice ( self , start, end)
697
+ & self [ start .. end]
724
698
}
725
699
726
700
#[ inline]
727
701
fn slice_from < ' a > ( & ' a self , start : uint ) -> & ' a [ T ] {
728
- core_slice :: SliceExt :: slice_from ( self , start)
702
+ & self [ start .. ]
729
703
}
730
704
731
705
#[ inline]
732
706
fn slice_to < ' a > ( & ' a self , end : uint ) -> & ' a [ T ] {
733
- core_slice :: SliceExt :: slice_to ( self , end)
707
+ & self [ .. end]
734
708
}
735
709
736
710
#[ inline]
@@ -834,17 +808,17 @@ impl<T> SliceExt for [T] {
834
808
835
809
#[ inline]
836
810
fn slice_mut < ' a > ( & ' a mut self , start : uint , end : uint ) -> & ' a mut [ T ] {
837
- core_slice :: SliceExt :: slice_mut ( self , start, end)
811
+ & mut self [ start .. end]
838
812
}
839
813
840
814
#[ inline]
841
815
fn slice_from_mut < ' a > ( & ' a mut self , start : uint ) -> & ' a mut [ T ] {
842
- core_slice :: SliceExt :: slice_from_mut ( self , start)
816
+ & mut self [ start .. ]
843
817
}
844
818
845
819
#[ inline]
846
820
fn slice_to_mut < ' a > ( & ' a mut self , end : uint ) -> & ' a mut [ T ] {
847
- core_slice :: SliceExt :: slice_to_mut ( self , end)
821
+ & mut self [ .. end]
848
822
}
849
823
850
824
#[ inline]
0 commit comments