Substitute ...
with the expanded form
RangeInclusive { start, end }, this way we supress the warnings about `...` in expressions being deprecated until `..=` is available in the compiler
This commit is contained in:
parent
e64efc91f4
commit
4737c5a068
@ -16,9 +16,8 @@
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
// FIXME: replace remaining ... by ..= after next stage0
|
||||
// Silence warning: "... is being replaced by ..="
|
||||
#![cfg_attr(not(stage0), allow(warnings))]
|
||||
// FIXME: after next stage0, change RangeInclusive { ... } back to ..=
|
||||
use ops::RangeInclusive;
|
||||
|
||||
// How this module is organized.
|
||||
//
|
||||
@ -1048,32 +1047,32 @@ impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
|
||||
|
||||
#[inline]
|
||||
fn get(self, slice: &[T]) -> Option<&[T]> {
|
||||
(0...self.end).get(slice)
|
||||
(RangeInclusive { start: 0, end: self.end }).get(slice)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> {
|
||||
(0...self.end).get_mut(slice)
|
||||
(RangeInclusive { start: 0, end: self.end }).get_mut(slice)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn get_unchecked(self, slice: &[T]) -> &[T] {
|
||||
(0...self.end).get_unchecked(slice)
|
||||
(RangeInclusive { start: 0, end: self.end }).get_unchecked(slice)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
(0...self.end).get_unchecked_mut(slice)
|
||||
(RangeInclusive { start: 0, end: self.end }).get_unchecked_mut(slice)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn index(self, slice: &[T]) -> &[T] {
|
||||
(0...self.end).index(slice)
|
||||
(RangeInclusive { start: 0, end: self.end }).index(slice)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn index_mut(self, slice: &mut [T]) -> &mut [T] {
|
||||
(0...self.end).index_mut(slice)
|
||||
(RangeInclusive { start: 0, end: self.end }).index_mut(slice)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user